diff options
author | Neil <nyamatongwe@gmail.com> | 2022-07-31 22:21:57 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-07-31 22:21:57 +1000 |
commit | d38429108f2035d9fab0919271f6715cd1b7eda6 (patch) | |
tree | 014b3bf217785e26e4c8db514fedf380d3bb007a /src/Indicator.cxx | |
parent | 926cb6f7d228b347db16a45e1f2632da475da1f0 (diff) | |
download | scintilla-mirror-d38429108f2035d9fab0919271f6715cd1b7eda6.tar.gz |
Add SC_MARK_BAR marker and INDIC_POINT_TOP indicator which are useful for change
history. Tweak size of INDIC_POINT and INDIC_POINTCHARACTER. Let translucency of
INDIC_COMPOSITIONTHICK be adjusted.
Diffstat (limited to 'src/Indicator.cxx')
-rw-r--r-- | src/Indicator.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx index bd02a01d1..cb7d5deba 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -252,7 +252,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r case IndicatorStyle::CompositionThick: { const PRectangle rcComposition(rc.left+1, rcLine.bottom-2, rc.right-1, rcLine.bottom); - surface->FillRectangle(rcComposition, sacDraw.fore); + surface->FillRectangle(rcComposition, ColourRGBA(sacDraw.fore, outlineAlpha)); } break; @@ -269,7 +269,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r 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 + 1.0f) + 0.5f; + const XYPOSITION iy = std::floor(rc.top) + 0.5f; const Point pts[] = { Point(ix - pixelHeight, iy + pixelHeight), // Left Point(ix + pixelHeight, iy + pixelHeight), // Right @@ -279,6 +279,22 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r } break; + 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 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 Point pts[] = { + Point(ix - pixelHeight, iy), // Left + Point(ix + pixelHeight, iy), // Right + Point(ix, iy + pixelHeight) // Bottom + }; + surface->Polygon(pts, std::size(pts), FillStroke(sacDraw.fore)); + } + break; + default: // Either IndicatorStyle::Plain or unknown surface->FillRectangle(PRectangle(rcAligned.left, ymid, |