notcurses icon indicating copy to clipboard operation
notcurses copied to clipboard

avoid resizing bitmap when source meets the destination

Open mjkpolo opened this issue 6 months ago • 4 comments

This addresses the FIXME here: https://github.com/dankamongmen/notcurses/blob/8edce88451f89544aec11e54278544532a7a98dd/src/lib/internal.h#L1736 I noticed some mild distortion when drawing a large bitmap with NCBLIT_2x1. This fixes my issue. It might not be very elegant so I'm open to any feedback!

mjkpolo avatar Aug 16 '25 00:08 mjkpolo

Neat! Let me take a look. If possible, I'd love to see examples of the problem you were seeing beforehand, and the results after your change, but that's not necessary.

dankamongmen avatar Aug 17 '25 08:08 dankamongmen

this looks simple enough, and correct. i'd like you to make the whitespace conform with the rest of the code, please.

i'm a bit worried about your claim that you were seeing distortion before, though. i'd like to see what kind of distortion you were running into. i'd love the relevant code/data, and ideally screenshots before and after. this certainly seems like something we can merge, though. i'm a bit surprised i didn't do it before, but [shrug] i'm glad you did!

dankamongmen avatar Aug 17 '25 08:08 dankamongmen

For sure! I think by tonight I can send some example code and screenshots of the problem. Thanks so much! This is an awesome tool

mjkpolo avatar Aug 17 '25 15:08 mjkpolo

If you need a more minimal example let me know, but here are some screenshots from my repo with and without the change where green circles are how it's supposed to look, and red circles are what it looks like without the patch

with_patch without_patch

The errors are from drawing this png so you can see the same distortion comparing to it

mjkpolo avatar Aug 17 '25 15:08 mjkpolo