aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
authormitchell <unknown>2019-03-31 23:20:01 -0400
committermitchell <unknown>2019-03-31 23:20:01 -0400
commit2c20e36f4ec739fd0887aceda589fce2c1757342 (patch)
tree7a00c34eab91ecec5e28a45df72f22d3c99d8701 /src/EditView.cxx
parentde07b9abd6711d657c170de23871ddb5503a1011 (diff)
downloadscintilla-mirror-2c20e36f4ec739fd0887aceda589fce2c1757342.tar.gz
Backport: Use generic versions of ceil, floor, round, lround, trunc from <cmath>.
Backport of changeset 7329:2662ef098d93, but without std::round and std::lround, since older Mac OSX SDKs may not have them.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 24be8b974..558a16b38 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -648,7 +648,7 @@ Range EditView::RangeDisplayLine(Surface *surface, const EditModel &model, Sci::
SelectionPosition EditView::SPositionFromLocation(Surface *surface, const EditModel &model, PointDocument pt, bool canReturnInvalid, bool charPosition, bool virtualSpace, const ViewStyle &vs) {
pt.x = pt.x - vs.textStart;
- Sci::Line visibleLine = static_cast<int>(floor(pt.y / vs.lineHeight));
+ Sci::Line visibleLine = static_cast<int>(std::floor(pt.y / vs.lineHeight));
if (!canReturnInvalid && (visibleLine < 0))
visibleLine = 0;
const Sci::Line lineDoc = model.pcs->DocFromDisplay(visibleLine);
@@ -815,7 +815,7 @@ static void DrawTextBlob(Surface *surface, const ViewStyle &vsDraw, PRectangle r
surface->FillRectangle(rcSegment, textBack);
}
FontAlias ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font;
- const int normalCharHeight = static_cast<int>(ceil(vsDraw.styles[STYLE_CONTROLCHAR].capitalHeight));
+ const int normalCharHeight = static_cast<int>(std::ceil(vsDraw.styles[STYLE_CONTROLCHAR].capitalHeight));
PRectangle rcCChar = rcSegment;
rcCChar.left = rcCChar.left + 1;
rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight;
@@ -1711,7 +1711,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
indentCount <= (ll->positions[i + 1] - epsilon) / indentWidth;
indentCount++) {
if (indentCount > 0) {
- const XYPOSITION xIndent = floor(indentCount * indentWidth);
+ const XYPOSITION xIndent = std::floor(indentCount * indentWidth);
DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
(ll->xHighlightGuide == xIndent));
}
@@ -1791,7 +1791,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
indentCount <= (ll->positions[cpos + ts.start + 1] - epsilon) / indentWidth;
indentCount++) {
if (indentCount > 0) {
- const XYPOSITION xIndent = floor(indentCount * indentWidth);
+ const XYPOSITION xIndent = std::floor(indentCount * indentWidth);
DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
(ll->xHighlightGuide == xIndent));
}
@@ -1868,7 +1868,7 @@ void EditView::DrawIndentGuidesOverEmpty(Surface *surface, const EditModel &mode
}
for (int indentPos = model.pdoc->IndentSize(); indentPos < indentSpace; indentPos += model.pdoc->IndentSize()) {
- const XYPOSITION xIndent = floor(indentPos * vsDraw.spaceWidth);
+ const XYPOSITION xIndent = std::floor(indentPos * vsDraw.spaceWidth);
if (xIndent < xStartText) {
DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcLine,
(ll->xHighlightGuide == xIndent));