diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-03-11 16:27:37 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-03-11 16:27:37 +0100 |
commit | 6697c42e7393ce469e8c58c9407930439208fb2a (patch) | |
tree | 780add2ae9fc7ce03dd9744aff9c3bd34ed5bf85 /dw/fltkviewbase.cc | |
parent | c93c8f584c02f2f35c0d050ab05eb05520b67586 (diff) |
fix clipped drawing of non-filled rectangles
To avoid artifacts we need clip with a rectangle that is line_width()
larger than our expose area.
Noticed by: corvid <corvid@lavabit.com>
Diffstat (limited to 'dw/fltkviewbase.cc')
-rw-r--r-- | dw/fltkviewbase.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dw/fltkviewbase.cc b/dw/fltkviewbase.cc index 97a78edb..437c109a 100644 --- a/dw/fltkviewbase.cc +++ b/dw/fltkviewbase.cc @@ -386,8 +386,11 @@ void FltkViewBase::drawRectangle (core::style::Color *color, int x2 = translateCanvasXToViewX (x + width); int y2 = translateCanvasYToViewY (y + height); - clipPoint (&x1, &y1); - clipPoint (&x2, &y2); + // We only support rectangles with line width 1px, so we clip with + // a rectangle 1px wider and higher than what we actually expose. + // This is only really necessary for non-filled rectangles. + clipPoint (&x1, &y1, 1); + clipPoint (&x2, &y2, 1); ::fltk::Rectangle rect (x1, y1, x2 - x1, y2 - y1); if (filled) |