Description
When logic gates are placed relatively, their placement reference ccan differ from absolute placement causing visible horizontal drift in stacked layouts
This is a problem is also a problem for any component that expands the bounds by drawing outside of the predefined interface bounds.
Potentially any future component that adds one-sided protrusions in its draw geometry is subject to this problem.
Below are tests output that clearly show the layout shift.
test_currently.pdf
test_expected.pdf
Reproduction
Use two gates one with a inverter that is placed absolutely and one placed relative to the first one:
#import "@local/zap:0.5.0"
#zap.circuit({
import zap: *
let land = land.with(debug: true)
land("a1", (0, 0), invert: true)
land("a2", (rel: (0, -1.25), to: "a1"), invert: true)
})
Zap Version
Development
Typst Version
0.14.2 (default)
Additional Context
This issue occurs when a component’s drawn bounding box differs from its logically defined bounding box. Absolute placement uses the correct local coordinate system, but relative placement uses the cetz default anchor, which is set to the origin of the actual drawn content. Therefore, the cetz default anchor should be set to the local origin (0, 0).
Description
When logic gates are placed relatively, their placement reference ccan differ from absolute placement causing visible horizontal drift in stacked layouts
This is a problem is also a problem for any component that expands the bounds by drawing outside of the predefined interface bounds.
Potentially any future component that adds one-sided protrusions in its draw geometry is subject to this problem.
Below are tests output that clearly show the layout shift.
test_currently.pdf
test_expected.pdf
Reproduction
Use two gates one with a inverter that is placed absolutely and one placed relative to the first one:
Zap Version
Development
Typst Version
0.14.2 (default)
Additional Context
This issue occurs when a component’s drawn bounding box differs from its logically defined bounding box. Absolute placement uses the correct local coordinate system, but relative placement uses the cetz default anchor, which is set to the origin of the actual drawn content. Therefore, the cetz default anchor should be set to the local origin (0, 0).