aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-09-25 11:40:13 +1000
committerNeil <nyamatongwe@gmail.com>2022-09-25 11:40:13 +1000
commita68a99a856e6818e4269b03c3fd97d84bf98d165 (patch)
tree2e791db5098de807ad2c1fd9886d4eec7b93e6d7 /src
parented7e87bfd2dfb8cbbab786b3742385de9d1e6a2a (diff)
downloadscintilla-mirror-a68a99a856e6818e4269b03c3fd97d84bf98d165.tar.gz
Enlarge point and point top indicators and scale to be larger with larger text.
Diffstat (limited to 'src')
-rw-r--r--src/EditView.cxx3
-rw-r--r--src/Indicator.cxx14
2 files changed, 9 insertions, 8 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 2290cf8a6..86e59b4dc 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -1244,7 +1244,8 @@ static void DrawIndicator(int indicNum, Sci::Position startPos, Sci::Position en
const XYPOSITION left = ll->XInLine(startPos) + horizontalOffset;
const XYPOSITION right = ll->XInLine(endPos) + horizontalOffset;
- const PRectangle rcIndic(left, rcLine.top + vsDraw.maxAscent, right, rcLine.top + vsDraw.maxAscent + 3);
+ const PRectangle rcIndic(left, rcLine.top + vsDraw.maxAscent, right,
+ std::max(rcLine.top + vsDraw.maxAscent + 3, rcLine.bottom));
if (bidiEnabled) {
ScreenLine screenLine(ll, subLine, vsDraw, rcLine.right - xStart, tabWidthMinimumPixels);
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
index cb7d5deba..5c15caeb6 100644
--- a/src/Indicator.cxx
+++ b/src/Indicator.cxx
@@ -265,15 +265,15 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
case IndicatorStyle::Point:
case IndicatorStyle::PointCharacter:
if (rcCharacter.Width() >= 0.1) {
- const XYPOSITION pixelHeight = std::floor(rc.Height() - 1.0f); // 1 pixel onto next line if multiphase
+ const XYPOSITION pixelHeight = std::floor(rc.Height()); // 1 pixel onto next line if multiphase
const XYPOSITION x = (sacDraw.style == IndicatorStyle::Point) ? (rcCharacter.left) : ((rcCharacter.right + rcCharacter.left) / 2);
// 0.5f is to hit midpoint of pixels:
const XYPOSITION ix = std::round(x) + 0.5f;
- const XYPOSITION iy = std::floor(rc.top) + 0.5f;
+ const XYPOSITION iy = std::ceil(rc.bottom) + 0.5f;
const Point pts[] = {
- Point(ix - pixelHeight, iy + pixelHeight), // Left
- Point(ix + pixelHeight, iy + pixelHeight), // Right
- Point(ix, iy) // Top
+ Point(ix - pixelHeight, iy), // Left
+ Point(ix + pixelHeight, iy), // Right
+ Point(ix, iy - pixelHeight) // Top
};
surface->Polygon(pts, std::size(pts), FillStroke(sacDraw.fore));
}
@@ -281,11 +281,11 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
case IndicatorStyle::PointTop:
if (rcCharacter.Width() >= 0.1) {
- const XYPOSITION pixelHeight = std::floor(rc.Height() - 1.0f); // 1 pixel onto previous line if multiphase
+ const XYPOSITION pixelHeight = std::floor(rc.Height()); // 1 pixel onto previous line if multiphase
const XYPOSITION x = rcCharacter.left;
// 0.5f is to hit midpoint of pixels:
const XYPOSITION ix = std::round(x) + 0.5f;
- const XYPOSITION iy = std::floor(rcLine.top) + 0.5f;
+ const XYPOSITION iy = std::floor(rcLine.top) - 0.5f;
const Point pts[] = {
Point(ix - pixelHeight, iy), // Left
Point(ix + pixelHeight, iy), // Right