From 9548dec5e36fb3b4c2e844da6d0c7b119940ad70 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 10 May 2000 11:53:11 +0000 Subject: Added underline attribute to styles. Added diagonal and strike-through indicators. --- src/Indicator.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Indicator.cxx') diff --git a/src/Indicator.cxx b/src/Indicator.cxx index fb6ad0915..05bdf66b5 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -37,6 +37,22 @@ void Indicator::Draw(Surface *surface, PRectangle &rc) { surface->MoveTo(x-3, ymid); surface->LineTo(x-3, ymid+2); } + } else if (style == INDIC_DIAGONAL) { + int x = rc.left; + while (x < rc.right) { + surface->MoveTo(x, rc.top+2); + int endX = x+3; + int endY = rc.top - 1; + if (endX > rc.right) { + endY += endX - rc.right; + endX = rc.right; + } + surface->LineTo(endX, endY); + x += 4; + } + } else if (style == INDIC_STRIKE) { + surface->MoveTo(rc.left, rc.top - 4); + surface->LineTo(rc.right, rc.top - 4); } else { // Either INDIC_PLAIN or unknown surface->MoveTo(rc.left, ymid); surface->LineTo(rc.right, ymid); -- cgit v1.2.3