diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-10-31 19:29:05 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-10-31 19:29:05 (GMT) |
commit | 03470f034404972c1e77607b6974048b912dba6e (patch) | |
tree | c6999c9cc1c592fe03ebbb480f8657e87ad8d5a9 /Desenho.py | |
parent | 98b0a0a50727554ef98e11aa63c6d7e13d2b6501 (diff) |
Fix freeform tool use with touch - part of SL#4074
To do easier show where the freeform will be closed,
a circle is displayed.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'Desenho.py')
-rw-r--r-- | Desenho.py | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -725,7 +725,6 @@ class Desenho: @param temp -- switch between drawing context and temp context @param fill -- Fill object """ - if param == "moving": # mouse not pressed moving if self.points: @@ -756,13 +755,32 @@ class Desenho: # close the polygon self.points.append((first[0], first[1])) self._draw_polygon(widget, False, fill, self.points) + widget.desenha = False widget.last = [] self.points = [] widget.enable_undo() - widget.queue_draw() return widget.desenha = True + + if self.points: + # Draw a circle to show where the freeform start/finish + ctx = widget.temp_ctx + ctx.save() + x_init, y_init = self.points[0] + ctx.new_path() + ctx.translate(x_init, y_init) + ctx.set_line_width(1) + ctx.set_source_rgba(1., 1., 1., 1.) + ctx.set_line_cap(cairo.LINE_CAP_ROUND) + ctx.set_line_join(cairo.LINE_JOIN_ROUND) + ctx.arc(0, 0, 20, 0., 2 * math.pi) + ctx.stroke_preserve() + ctx.set_dash([5, 5], 0) + ctx.set_source_rgba(0., 0., 0., 1.) + ctx.stroke() + ctx.restore() + # Display the polygon open in the temp canvas self._draw_polygon(widget, True, False, self.points, closed=False) self.clear_control_points() |