diff options
author | perepujal <perepujal> | 2011-05-18 19:53:48 (GMT) |
---|---|---|
committer | perepujal <perepujal> | 2011-05-18 19:53:48 (GMT) |
commit | a3508fd1913ee717347f6499b8653baa9af9c051 (patch) | |
tree | e19cdd2c6959206d1f3dd41192382674ed3101bc | |
parent | 9e9f2db8f51a790be98b0fa3ae8d61f6c9eb9dcc (diff) |
Fixing #300881 AKA drawing shapes at release. Removing ghost previews if you try to change the current shape before completing it.
-rw-r--r-- | src/tuxpaint.c | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/src/tuxpaint.c b/src/tuxpaint.c index fb5767b..c4b3d1a 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -4274,6 +4274,14 @@ static void mainloop(void) { cur_shape = cur_thing; + /* Remove ghost previews an reset the tool */ + if(shape_tool_mode != SHAPE_TOOL_MODE_DONE) + { + shape_tool_mode = SHAPE_TOOL_MODE_DONE; + update_canvas(0, 0, canvas->w, canvas->h); + } + + draw_tux_text(TUX_GREAT, shape_tips[cur_shape], 1); if (do_draw) @@ -4482,19 +4490,23 @@ static void mainloop(void) { /* Draw the shape with the brush! */ - /* (Arbitrarily large...) */ - reset_brush_counter(); - - playsound(screen, 1, SND_LINE_END, 1, event.button.x, - SNDDIST_NEAR); - do_shape(shape_ctr_x, shape_ctr_y, shape_outer_x, shape_outer_y, - shape_rotation(shape_ctr_x, shape_ctr_y, - event.button.x - r_canvas.x, - event.button.y - r_canvas.y), 1); + /* Only draw here in mouse accessibility mode as there IS a mouse */ + /* See #300881 for the reasons that this is deplaced to draw in mouse release */ + if(mouseaccessibility) + { + /* (Arbitrarily large...) */ + reset_brush_counter(); - shape_tool_mode = SHAPE_TOOL_MODE_DONE; - draw_tux_text(TUX_GREAT, tool_tips[TOOL_SHAPES], 1); + playsound(screen, 1, SND_LINE_END, 1, event.button.x, + SNDDIST_NEAR); + do_shape(shape_ctr_x, shape_ctr_y, shape_outer_x, shape_outer_y, + shape_rotation(shape_ctr_x, shape_ctr_y, + event.button.x - r_canvas.x, + event.button.y - r_canvas.y), 1); + shape_tool_mode = SHAPE_TOOL_MODE_DONE; + draw_tux_text(TUX_GREAT, tool_tips[TOOL_SHAPES], 1); + } } else if (shape_tool_mode == SHAPE_TOOL_MODE_STRETCH) /* Only reached in accessibility mode */ @@ -5014,6 +5026,20 @@ static void mainloop(void) draw_tux_text(TUX_GREAT, tool_tips[TOOL_SHAPES], 1); } } + else if (shape_tool_mode == SHAPE_TOOL_MODE_ROTATE) + { + reset_brush_counter(); + + playsound(screen, 1, SND_LINE_END, 1, event.button.x, + SNDDIST_NEAR); + do_shape(shape_ctr_x, shape_ctr_y, shape_outer_x, shape_outer_y, + shape_rotation(shape_ctr_x, shape_ctr_y, + event.button.x - r_canvas.x, + event.button.y - r_canvas.y), 1); + + shape_tool_mode = SHAPE_TOOL_MODE_DONE; + draw_tux_text(TUX_GREAT, tool_tips[TOOL_SHAPES], 1); + } } } else if (cur_tool == TOOL_MAGIC && (magics[cur_magic].mode == MODE_PAINT || magics[cur_magic].mode == MODE_ONECLICK || magics[cur_magic].mode == MODE_PAINT_WITH_PREVIEW)) |