From 6b84efa86ef5df82da8adac1debda459b59e9ba8 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 10 Nov 2020 13:28:40 -0500 Subject: [PATCH] Additional correction for the CIF "close" operator. --- cif/CIFgen.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cif/CIFgen.c b/cif/CIFgen.c index bf14faf5..90f92c87 100644 --- a/cif/CIFgen.c +++ b/cif/CIFgen.c @@ -2012,8 +2012,22 @@ cifGatherFunc(tile, atotal, mode) } else if (mode == CLOSE_FILL) { - DBNMPaintPlane(cifPlane, TiGetTypeExact(tile), &area, CIFPaintTable, - (PaintUndoInfo *)NULL); + TileType dinfo = TiGetTypeExact(tile); + + /* The recursive call to cifGatherFunc() below means that the */ + /* tile type cannot be depended on to have the TT_SIDE bit set */ + /* for the side of the tile that is TT_SPACE. So set the */ + /* side bit manually. */ + + if (IsSplit(tile)) + { + if (TiGetLeftType(tile) == TT_SPACE) + dinfo &= ~TT_SIDE; + else + dinfo |= TT_SIDE; + } + + DBNMPaintPlane(cifPlane, dinfo, &area, CIFPaintTable, (PaintUndoInfo *)NULL); CIFTileOps++; }