From 3dd46bb1c42b3a799d144b37f5811ee5999ef74e Mon Sep 17 00:00:00 2001 From: werner Date: Sat, 8 Aug 2009 19:01:45 +0000 Subject: [PATCH] - zoom and center changed the coordinate system and did a redraw while hovering, upsetting the overlays git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5408 99fdad57-331a-0410-800a-d7fa5415bdb3 --- gui_canvas.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gui_canvas.c b/gui_canvas.c index 182ad10..9ddb4dd 100644 --- a/gui_canvas.c +++ b/gui_canvas.c @@ -190,8 +190,10 @@ static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event, redraw(); break; case 2: + tool_dehover(); draw_ctx.center = pos; redraw(); + tool_hover(canvas_to_coord(event->x, event->y)); break; } return TRUE; @@ -228,11 +230,13 @@ static void zoom_in(struct coord pos) { if (draw_ctx.scale < 2) return; + tool_dehover(); draw_ctx.scale /= 2; draw_ctx.center.x = (draw_ctx.center.x+pos.x)/2; draw_ctx.center.y = (draw_ctx.center.y+pos.y)/2; update_zoom(); redraw(); + tool_hover(pos); } @@ -248,11 +252,13 @@ static void zoom_out(struct coord pos) bbox.max.x < draw_ctx.widget->allocation.width-ZOOM_STOP_BORDER && bbox.min.y < draw_ctx.widget->allocation.height-ZOOM_STOP_BORDER) return; + tool_dehover(); draw_ctx.scale *= 2; draw_ctx.center.x = 2*draw_ctx.center.x-pos.x; draw_ctx.center.y = 2*draw_ctx.center.y-pos.y; update_zoom(); redraw(); + tool_hover(pos); } @@ -296,18 +302,24 @@ static gboolean key_press_event(GtkWidget *widget, GdkEventKey *event, zoom_out(pos); break; case '*': + tool_dehover(); center(NULL); auto_scale(NULL); redraw(); + tool_hover(canvas_to_coord(curr_pos.x, curr_pos.y)); break; case '#': + tool_dehover(); center(&active_frame_bbox); auto_scale(&active_frame_bbox); redraw(); + tool_hover(canvas_to_coord(curr_pos.x, curr_pos.y)); break; case '.': + tool_dehover(); draw_ctx.center = pos; redraw(); + tool_hover(canvas_to_coord(curr_pos.x, curr_pos.y)); break; case GDK_BackSpace: case GDK_Delete: