diff options
| author | mitchell <unknown> | 2018-05-06 09:16:53 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2018-05-06 09:16:53 -0400 |
| commit | 91bdbe3b40b76e9ea822ee750b4ab543f4bb105d (patch) | |
| tree | 13ff976a6dd0cb0b43d8dae12319629856a215d4 /src/CallTip.cxx | |
| parent | 74a34523f9c17cdca12143d31a578d8565b1922d (diff) | |
| download | scintilla-mirror-91bdbe3b40b76e9ea822ee750b4ab543f4bb105d.tar.gz | |
Backport: Feature [feature-requests:#1215]. Use standard functions in prference to RoundXYPosition, XYMinimum, and XYMaximum.
Backport of changeset 6713:fadc4c551b6d.
Diffstat (limited to 'src/CallTip.cxx')
| -rw-r--r-- | src/CallTip.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 3d62dba88..ffd808c66 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -8,6 +8,7 @@ #include <cstdlib> #include <cstring> #include <cstdio> +#include <cmath> #include <stdexcept> #include <string> @@ -150,7 +151,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, } else if (IsTabCharacter(s[startSeg])) { xEnd = NextTabPos(x); } else { - xEnd = x + RoundXYPosition(surface->WidthText(font, s + startSeg, endSeg - startSeg)); + xEnd = x + lround(surface->WidthText(font, s + startSeg, endSeg - startSeg)); if (draw) { rcClient.left = static_cast<XYPOSITION>(x); rcClient.right = static_cast<XYPOSITION>(xEnd); @@ -172,7 +173,7 @@ int CallTip::PaintContents(Surface *surfaceWindow, bool draw) { PRectangle rcClient(1.0f, 1.0f, rcClientSize.right - 1, rcClientSize.bottom - 1); // To make a nice small call tip window, it is only sized to fit most normal characters without accents - const int ascent = RoundXYPosition(surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font)); + const int ascent = lround(surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font)); // For each line... // Draw the definition in three parts: before highlight, highlighted, after highlight @@ -281,7 +282,7 @@ PRectangle CallTip::CallTipStart(Sci::Position pos, Point pt, int textHeight, co look = newline + 1; numLines++; } - lineHeight = RoundXYPosition(surfaceMeasure->Height(font)); + lineHeight = lround(surfaceMeasure->Height(font)); // The returned // rectangle is aligned to the right edge of the last arrow encountered in |
