From 712c48218c8394ff69e07eebffa2ce7347041f7d Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 2 Jun 2011 17:13:04 +1000 Subject: Added new indicators: dashed and dotted underlines. --- src/Indicator.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/Indicator.cxx b/src/Indicator.cxx index 5c352bf1c..c1d07b2e6 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -73,6 +73,20 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r rcBox.left = rc.left; rcBox.right = rc.right; surface->AlphaRectangle(rcBox, (style == INDIC_ROUNDBOX) ? 1 : 0, fore.allocated, fillAlpha, fore.allocated, outlineAlpha, 0); + } else if (style == INDIC_DASH) { + int x = rc.left; + while (x < rc.right) { + surface->MoveTo(x, ymid); + surface->LineTo(Platform::Minimum(x + 4, rc.right), ymid); + x += 7; + } + } else if (style == INDIC_DOTS) { + int x = rc.left; + while (x < rc.right) { + PRectangle rcDot(x, ymid, x+1, ymid+1); + surface->FillRectangle(rcDot, fore.allocated); + x += 2; + } } else { // Either INDIC_PLAIN or unknown surface->MoveTo(rc.left, ymid); surface->LineTo(rc.right, ymid); -- cgit v1.2.3