From d38429108f2035d9fab0919271f6715cd1b7eda6 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 31 Jul 2022 22:21:57 +1000 Subject: 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. --- src/Indicator.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/Indicator.cxx') 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, -- cgit v1.2.3