Closed SekoiaTree closed 6 months ago
Hi @SekoiaTree ,
The reason for it being non-transparent is so that the underlying wires are overdrawn. To illustrate, let's add some wires:
Initially, I spent a lot of effort to allow transparent gates and everything but it turned out very tricky with many special cases. It seemed better to not allow transparent gates. For gates, this seems okay to me but I have to admit that I did not think of your case with midstick.
I see two solutions:
1) We can add a fill
parameter to midstick()
, so you can pass the same background color to it. To use it now, just add the following code to your file:
#let midstick(content, fill: none, label: none) = gate(content, draw-function: draw-functions.draw-unboxed-gate, label: label, fill: fill)
and use it with midstick(fill: aqua, ...)
2) The other option is to rewrite a lot of the internals and make transparent gates and co. happen. This is a large effort for not too many benefits but I won't quite say that it will not happen ;)
Thanks for pointing this out!
I don't know hugely much of the internals, but can't you "just" have slice
pass its own background color as the default setting for the fill?
Edit: Ah, there's no concept of "on top of", so a gate can't know it's on top of a slice.
Precisely. Just like similar packages in LaTeX, gategroup
does not actually "group" the elements that it covers. It is just drawn below.
With 6ebf10, a fill
parameter has been added to midstick
. With the new release (v0.2.1), this feature is available (package pull request pending).
A slice with a background color, combined with a midstick, will have an extra background color.
Minimal example:
Workaround: redefine draw-unboxed-gate and midstick.