diff options
-rw-r--r-- | src/Editor.cxx | 4 | ||||
-rw-r--r-- | src/LineMarker.cxx | 2 | ||||
-rw-r--r-- | src/Style.h | 2 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index bb5813686..421f33220 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1947,8 +1947,8 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { } PRectangle rcNumber = rcMarker; // Right justify - int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number)); - int xpos = rcNumber.right - width - 3; + XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number)); + XYPOSITION xpos = rcNumber.right - width - 3; rcNumber.left = xpos; surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font, rcNumber.top + vs.maxAscent, number, istrlen(number), diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 267ea18f4..99e83265e 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -338,7 +338,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac } else if (markType >= SC_MARK_CHARACTER) { char character[1]; character[0] = static_cast<char>(markType - SC_MARK_CHARACTER); - int width = surface->WidthText(fontForCharacter, character, 1); + XYPOSITION width = surface->WidthText(fontForCharacter, character, 1); rc.left += (rc.Width() - width) / 2; rc.right = rc.left + width; surface->DrawTextClipped(rc, fontForCharacter, rc.bottom - 2, diff --git a/src/Style.h b/src/Style.h index 018ab70f5..cccf18f3e 100644 --- a/src/Style.h +++ b/src/Style.h @@ -47,7 +47,7 @@ struct FontMeasurements { unsigned int ascent; unsigned int descent; unsigned int externalLeading; - unsigned int aveCharWidth; + XYPOSITION aveCharWidth; XYPOSITION spaceWidth; int sizeZoomed; FontMeasurements(); diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 61e8b34d5..baa2e9ef5 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1611,7 +1611,7 @@ XYPOSITION SurfaceD2D::WidthText(Font &font_, const char *s, int len) { pTextLayout->Release(); } } - return int(width + 0.5); + return width; } void SurfaceD2D::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions) { @@ -1754,7 +1754,7 @@ XYPOSITION SurfaceD2D::AverageCharWidth(Font &font_) { pTextLayout->Release(); } } - return int(width + 0.5); + return width; } void SurfaceD2D::SetClip(PRectangle rc) { |