From 460a3577306b464228833f9ef4610bd26afb68c0 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Sun, 22 Mar 2026 13:11:27 -0400 Subject: [PATCH] Corrected what appears to be a long-standing error in the GDS read routine, in which it calls the same "cleanup" routine as for CIF files, which in turn processes the top level cell. However, GDS doesn't have the same concept of a top level cell, so it ends up re-processing part of the last cell read. This would appear to be harmless, except that there is some kind of scaling discrepancy in which the cell bounding box can get incorrectly scaled by the cleanup routine. The solution appears to be simply (?) to not do the "top level" processing. Bypassing the CIFPaintCurrent() from the cleanup routine when reading a GDS file appears to solve the problem. --- cif/CIFrdcl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cif/CIFrdcl.c b/cif/CIFrdcl.c index c965bbaa..0f1cd370 100644 --- a/cif/CIFrdcl.c +++ b/cif/CIFrdcl.c @@ -1786,8 +1786,8 @@ CIFReadCellCleanup( } /* Do geometrical processing on the top-level cell. */ + if (filetype == FILE_CIF) CIFPaintCurrent(filetype); - CIFPaintCurrent(FILE_CIF); DBAdjustLabels(EditCellUse->cu_def, &TiPlaneRect); DBReComputeBbox(EditCellUse->cu_def); DBWAreaChanged(EditCellUse->cu_def, &EditCellUse->cu_def->cd_bbox,