cmang / durdraw

Versatile ASCII and ANSI Art text editor for drawing in the Linux/Unix/macOS terminal, with animation, 256 and 16 colors, Unicode and CP437, and customizable themes
http://durdraw.org
BSD 3-Clause "New" or "Revised" License
710 stars 20 forks source link

Esc-[ can't change character sets in Playback mode #64

Open AdrianGroty opened 5 months ago

AdrianGroty commented 5 months ago

I discovered recently that edits made while an animation is playing are applied to all frames in the playback range, which is super convenient! (Though, I do not believe this is mentioned anywhere in the documentation.)

Adding and removing columns works this way, as does removing lines, but I cannot seem to add a line while an animation is playing, neither with esc+/ nor with alt+/.

I can achieve the desired outcome by cutting/pasting across all frames in range when the affected area is the same in all frames, but this can be a bear if I need to shift an entire animation downward or create more space at the top of the image.

Thanks!

cmang commented 5 months ago

Weird. There was a typo preventing this from working. It should be fixed in the "dev" branch now. Can you please verify?

Thanks for the report!

cmang commented 5 months ago

edits made while an animation is playing are applied to all frames in the playback range, which is super convenient! (Though, I do not believe this is mentioned anywhere in the documentation.)

You're right.. it probably should be. I'll have to mention this in the help file. I think it's a pretty cool feature, too. As far as I know, it's unique to Durdraw. I was going to cover animation in the Pt 2 video tutorial, when I get around to it.

I'm glad to see that you're playing with the animation features, btw! :)

AdrianGroty commented 5 months ago

Works like a charm; thanks!

AdrianGroty commented 5 months ago

Oh! And I believe there is a similar issue with the alt/esc+[ shortcut for cycling to the previous f1-f10 character palette.

cmang commented 5 months ago

Oh! And I believe there is a similar issue with the alt/esc+[ shortcut for cycling to the previous f1-f10 character palette.

That one is a little weirder and trickier. I'm not yet sure why that doesn't work, but I think the esc-[ gets misunderstood by Durdraw as an escape control code (which also uses the [ character), and doesn't register properly. I did implement esc-pgup and esc-pgdown as an alternative to esc-durdraw/durdraw_ui_curses.py#1348:

1348                 elif c == 91 or c == 339:   # alt-[ previous character set. apparently this doesn't work
1349                     self.prevCharSet() # during playback, c == -1, so 339 is alt-pgup, as a backup

It's ugly. I don't like it. I'll revisit this issue and see if I can come up with something better.