diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-03-27 08:45:09 +0100 |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-03-27 15:27:01 +0100 |
commit | 95d189ee0df74497d70449f3967a38c67f5860ae (patch) | |
tree | 18d4ed4bed300cc727a7883eecf3ee1b79a3d90a | |
parent | 4833b02f80bc5bcd7b0946453f3e6c7bc09b01f6 (diff) |
Fix mismatch between stroke and fill of ellipses on X11.
When drawing ellipse without stroke we need to use the same width/height
for the fill as we would use for the stroke for the stroke and fill to
match. Filling first and then stroking should produce the same result as
filling and stroking in one go.
Task-number: 249490
Reviewed-by: Trond
-rw-r--r-- | src/gui/painting/qpaintengine_x11.cpp | 10 | ||||
-rw-r--r-- | tests/arthur/data/qps/primitives.qps | 19 |
2 files changed, 22 insertions, 7 deletions
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index e9f1bb362a..32cb63dfc7 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1479,14 +1479,10 @@ void QX11PaintEngine::drawEllipse(const QRect &rect) return; } d->setupAdaptedOrigin(rect.topLeft()); - if (d->has_brush) { // draw filled ellipse - if (!d->has_pen) { - XFillArc(d->dpy, d->hd, d->gc_brush, x, y, w-1, h-1, 0, 360*64); + if (d->has_brush) { // draw filled ellipse + XFillArc(d->dpy, d->hd, d->gc_brush, x, y, w, h, 0, 360*64); + if (!d->has_pen) // make smoother outline XDrawArc(d->dpy, d->hd, d->gc_brush, x, y, w-1, h-1, 0, 360*64); - return; - } else{ - XFillArc(d->dpy, d->hd, d->gc_brush, x, y, w, h, 0, 360*64); - } } if (d->has_pen) // draw outline XDrawArc(d->dpy, d->hd, d->gc, x, y, w, h, 0, 360*64); diff --git a/tests/arthur/data/qps/primitives.qps b/tests/arthur/data/qps/primitives.qps index dcb651696d..c4cc92cf5d 100644 --- a/tests/arthur/data/qps/primitives.qps +++ b/tests/arthur/data/qps/primitives.qps @@ -177,3 +177,22 @@ repeat_block drawShapes setPen black 4 translate 75 0 repeat_block drawShapes + +resetMatrix +setRenderHint Antialiasing off +setPen nopen +translate 550 100 +setBrush #7f7f7fff +drawRect -0.5 -0.5 21 21 +setBrush red +drawEllipse 0 0 20 20 +setBrush nobrush +setPen black +drawEllipse 0 0 20 20 + +translate 25 0 +setPen nopen +setBrush #7f7f7fff +drawRect 0 0 20 20 +setBrush red +drawEllipse 0 0 20 20 |