mattn / go-sixel

DRCS/Sixel Encoder/Decoder
MIT License
152 stars 11 forks source link

gosgif: position is not restored #8

Closed ktye closed 5 years ago

ktye commented 5 years ago

Gosgif does not restore the position (at least on mintty). This can be seen when playing small gifs, e.g. (64x64): https://thumbs.gfycat.com/AdorableFlawedAdouri-max-1mb.gif

During the animation the old frames are shown on top and the console scrolls. The current frame is always on the bottom.

Is this expected behaviour, or should the old frames be erased?

ktye commented 5 years ago

This issue occurs only, if the terminal is already on the bottom row. It stores the position (which is the bottom), prints the image, which scrolls and restores the bottom position before each frame. I'm not sure how that could be fixed. Maybe calculate the image height, check if it fits without scrolling, if not, scroll before printing the first frame.

mattn commented 5 years ago

Now fixed in last change.