From 83669c6db7b6561c7ea685e716dcdab839c75879 Mon Sep 17 00:00:00 2001 From: werner Date: Tue, 15 Dec 2009 20:05:37 +0000 Subject: [PATCH] When entering the first vectors, where were a number of display anomalies such a vectors pointing in the wrong direction. They were caused by overflows due to inadequate zoom settings. - gui.c (change_world): if the extents have grown, zoom to extents git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5756 99fdad57-331a-0410-800a-d7fa5415bdb3 --- gui.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gui.c b/gui.c index 0bd18c0..62484c8 100644 --- a/gui.c +++ b/gui.c @@ -252,12 +252,20 @@ static void make_center_area(GtkWidget *vbox) void change_world(void) { + struct bbox before, after; + inst_deselect(); status_begin_reporting(); + before = inst_get_bbox(); instantiate(); + after = inst_get_bbox(); label_in_box_bg(active_frame->label, COLOR_FRAME_SELECTED); build_frames(frames_box); - redraw(); + if (after.min.x < before.min.x || after.min.y < before.min.y || + after.max.x > before.max.x || after.max.y > before.max.y) + zoom_to_extents(); + else + redraw(); }