From 8ca2db78a2e7bb8467142f6095f7d9b13b4577ff Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 26 Sep 2017 14:09:35 -0400 Subject: [PATCH] Corrected failure to update root box and crosshair position when rescaling the internal units. The former in particular can cause problems when moving the root box and importing cells from a script (same change as made to magic-8.1). --- database/DBcellsrch.c | 9 +++++++++ dbwind/DBWtools.c | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/database/DBcellsrch.c b/database/DBcellsrch.c index f4b97aa3..a8fb9edc 100644 --- a/database/DBcellsrch.c +++ b/database/DBcellsrch.c @@ -1453,6 +1453,9 @@ void DBScaleEverything(scalen, scaled) int scalen, scaled; { + void ToolScaleBox(); + void DBWScaleCrosshair(); + int dbCellDefEnumFunc(); LinkedCellDef *lhead, *lcd; @@ -1484,6 +1487,12 @@ DBScaleEverything(scalen, scaled) /* Recovery of global plane pointers */ MZAttachHintPlanes(); + /* Modify root box */ + ToolScaleBox(scalen, scaled); + + /* Modify crosshair position */ + DBWScaleCrosshair(scalen, scaled); + SigEnableInterrupts(); } diff --git a/dbwind/DBWtools.c b/dbwind/DBWtools.c index 3dc6696b..b6b14f87 100644 --- a/dbwind/DBWtools.c +++ b/dbwind/DBWtools.c @@ -191,6 +191,18 @@ ToolGetBox(rootDef, rootArea) return TRUE; } +/* ToolScaleBox --- Simple scaling of the root area box, no update needed */ + +void +ToolScaleBox(scalen, scaled) + int scalen; + int scaled; +{ + DBScalePoint(&boxRootArea.r_ll, scalen, scaled); + DBScalePoint(&boxRootArea.r_ur, scalen, scaled); + +} + /* * ---------------------------------------------------------------------------- @@ -474,6 +486,16 @@ DBWDrawCrosshair(window, plane) window->w_screenArea.r_xtop, p.p_y); } +/* DBWScaleCrosshair --- Simple scaling of the crosshair point, no update needed */ + +void +DBWScaleCrosshair(scalen, scaled) + int scalen; + int scaled; +{ + DBScalePoint(&crosshairPos, scalen, scaled); +} + /* * ---------------------------------------------------------------------------- * DBWSetCrosshair --