From a2b8738d552f7e768aa1f98f32fd4b8a7422a8db Mon Sep 17 00:00:00 2001 From: Peter Clifton Date: Sun, 13 Apr 2008 16:17:01 +0000 Subject: [PATCH] Applied patch from Tomaz Solc fixing a bug in the CenterDisplay function. This patch fixes a bug in the CenterDisplay function that doesn't do a RestoreCrosshair() after HideCrosshair(). This causes the crosshair stack overflow when using the DRC checker (which calls CenterDisplay a lot). Minor re-indentation by Peter Clifton during application. --- src/misc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/misc.c b/src/misc.c index bb087fbe..65dfc044 100644 --- a/src/misc.c +++ b/src/misc.c @@ -550,9 +550,16 @@ CenterDisplay (LocationType X, LocationType Y, Boolean Delta) int save_grid = PCB->Grid; PCB->Grid = 1; if (Delta) - MoveCrosshairRelative (X, Y); + { + MoveCrosshairRelative (X, Y); + } else - MoveCrosshairAbsolute (X, Y); + { + if (MoveCrosshairAbsolute (X, Y)) + { + RestoreCrosshair(False); + } + } gui->set_crosshair (Crosshair.X, Crosshair.Y, HID_SC_WARP_POINTER); PCB->Grid = save_grid; } -- 2.11.4.GIT