New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--loop disables generating multiple files #50
Comments
Thanks for the report! To clarify, does running it with |
There are a couple of paths through the Cairo Backend, and the As a stopgap, here's the bash code I use for looping: alias ghcsandbox='ghc -global-package-db -no-user-package-db -package-db .cabal-sandbox/$(uname -m)-linux-ghc-$(ghc --numeric-version)-packages.conf.d/ -O2'
function diagramwatch {
while true
do inotifywait $1.hs && ghcsandbox $1 && $1
done
} |
The latter: Only one frame the first time. |
I think I see what's going on. The One possible solution is to have |
Complicated by the fact that `defaultAnimMainRender` doesn't know what data type a backend is using for its options, or even whether it has looping options at all, so it has to take an extra argument which is `Maybe` a setter for the looping options. It uses this to set looping to `False` for all but the last frame.
See the commit above for a potential solution; feedback welcome. Note this would require changes to |
This is somewhat related to the fix here, but I think we should get rid of the CPP in the mainable instances guarding the platforms that don't support looping. If we can't figure out how to do looping on Windows, we should just have some backup interactive loop where on a key press we recompile. |
I’m using
Diagrams.Backend.Cairo.Cmdline.mainWith
, passing anAnimation B R2
. Running the resulting program creates many frames. Running it with-l
creates only the first one.This is diagrams 1.2.
The text was updated successfully, but these errors were encountered: