summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2010-02-22 10:45:58 -0700
committerScott Moreau <oreaus@gmail.com>2010-02-22 11:06:09 -0700
commit4360728006585da95738d2aafda436e0fd8fa148 (patch)
tree46de6039eca6c69524791ab4d00a5f822d3b49d6
parent374393a340dfefbac9c6441d6c1a3cbf80d2b220 (diff)
downloadcompiz-core-doc-4360728006585da95738d2aafda436e0fd8fa148.tar.gz
compiz-core-doc-4360728006585da95738d2aafda436e0fd8fa148.tar.bz2
Draw more finely granulated ellipse outline.
-rw-r--r--plugins/annotate/src/annotate.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/annotate/src/annotate.cpp b/plugins/annotate/src/annotate.cpp
index 76a2a94..3f08929 100644
--- a/plugins/annotate/src/annotate.cpp
+++ b/plugins/annotate/src/annotate.cpp
@@ -613,6 +613,8 @@ AnnoScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
float vectorX, vectorY, offset;
int angle;
+ offset = optionGetStrokeWidth () / 2;
+
/* This replaced prepareXCoords (s, output, -DEFAULT_Z_CAMERA) */
sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
@@ -682,7 +684,6 @@ AnnoScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
/* draw rectangle outline */
glColor4usv (optionGetStrokeColor ());
- offset = optionGetStrokeWidth () / 2;
glRecti (rectangle.x1 () - offset, rectangle.y2 (),
rectangle.x1 () + offset, rectangle.y1 ());
glRecti (rectangle.x2 () - offset, rectangle.y2 (),
@@ -715,19 +716,24 @@ AnnoScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
glColor4usv (optionGetStrokeColor ());
glLineWidth (optionGetStrokeWidth ());
- glBegin (GL_LINE_STRIP);
+ glBegin (GL_TRIANGLE_STRIP);
glVertex2d (ellipse.center.x (), ellipse.center.y () +
- ellipse.radiusY);
- for (angle = 0; angle <= 360; angle += 1)
+ ellipse.radiusY - offset);
+ for (angle = 360; angle >= 0; angle -= 1)
{
- vectorX = ellipse.center.x () +
- (ellipse.radiusX * sinf (angle * DEG2RAD));
- vectorY = ellipse.center.y () +
- (ellipse.radiusY * cosf (angle * DEG2RAD));
+ vectorX = ellipse.center.x () + ((ellipse.radiusX -
+ offset) * sinf (angle * DEG2RAD));
+ vectorY = ellipse.center.y () + ((ellipse.radiusY -
+ offset) * cosf (angle * DEG2RAD));
+ glVertex2d (vectorX, vectorY);
+ vectorX = ellipse.center.x () + ((ellipse.radiusX +
+ offset) * sinf (angle * DEG2RAD));
+ vectorY = ellipse.center.y () + ((ellipse.radiusY +
+ offset) * cosf (angle * DEG2RAD));
glVertex2d (vectorX, vectorY);
}
glVertex2d (ellipse.center.x (), ellipse.center.y () +
- ellipse.radiusY);
+ ellipse.radiusY + offset);
glEnd();
break;