diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2013-05-16 21:24:19 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2013-05-17 20:10:19 (GMT) |
commit | c6a03c79cfda4cb543334e951e58da3eb04f4a0a (patch) | |
tree | 6083ba823124ce7c1f63b8eac791346dc19c202c /Desenho.py | |
parent | 195da210989f287066bdf89864f4ed05103cca7d (diff) |
Solve the draw of shapes with alpha with big line width - SL #3789
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'Desenho.py')
-rw-r--r-- | Desenho.py | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -343,16 +343,20 @@ class Desenho: else: ctx.set_line_cap(cairo.LINE_CAP_SQUARE) ctx.set_line_join(cairo.LINE_JOIN_MITER) + ctx.set_line_width(widget.tool['line size']) if fill: + ctx.save() ctx.set_source_rgba(*widget.tool['cairo_fill_color']) - ctx.set_line_width(0) ctx.fill_preserve() + ctx.set_operator(cairo.OPERATOR_SOURCE) + ctx.set_source_rgba(1.0, 1.0, 1.0, 1) + ctx.stroke_preserve() + ctx.restore() if widget.tool['name'] == 'eraser': ctx.set_source_rgba(1.0, 1.0, 1.0, 1.0) else: ctx.set_source_rgba(*widget.tool['cairo_stroke_color']) - ctx.set_line_width(widget.tool['line size']) ctx.stroke() ctx.restore() if fill or closed: @@ -525,8 +529,14 @@ class Desenho: ctx.set_line_width(line_width / w) if fill: + ctx.save() ctx.set_source_rgba(*widget.tool['cairo_fill_color']) ctx.fill_preserve() + ctx.set_operator(cairo.OPERATOR_SOURCE) + ctx.set_source_rgba(1.0, 1.0, 1.0, 1) + ctx.stroke_preserve() + ctx.restore() + ctx.set_source_rgba(*widget.tool['cairo_stroke_color']) ctx.stroke() ctx.restore() @@ -560,8 +570,14 @@ class Desenho: ctx.arc(0., 0., 1., 0., 2 * math.pi) ctx.set_line_width(line_width / float(min(dx, dy))) if fill: + ctx.save() ctx.set_source_rgba(*widget.tool['cairo_fill_color']) ctx.fill_preserve() + ctx.set_operator(cairo.OPERATOR_SOURCE) + ctx.set_source_rgba(1.0, 1.0, 1.0, 1) + ctx.stroke_preserve() + ctx.restore() + ctx.set_source_rgba(*widget.tool['cairo_stroke_color']) ctx.stroke() ctx.restore() |