Conversation
|
taking a look at this, although the failure cases you describe seem like they would have been seen elsewhere. can you please provide some triggering code, so i can make it into a unit test? |
|
Ok, this is a simple program, that tries to render the middle of an image. There are two modes: "simple" to allocate a new plane by hand and "child" to ask notcurses to do it. Observed behavior:
This is my code: |
|
Also this is code, suitable for unit tests, that checks at least ncvisual_geom. Rcelly/rcellx are incorrect, i expect to get 10x40, but get 20x40 |
|
I found out, that I only fixed code in visual.c, but there are similar places in direct.c ( ncdirectf_render and ncdirectf_geom, for example). Not sure, if begy/begx need to be supported in direct mode. If you want, I can fix direct.c in similar way. Not sure, whether you'll want to merge this patch. |
Currently using begy/begx or leny/lenx results in wrong behavior or segmentation faults.
I tested it on kitty and foot:
The reason for this behavour is missing handling of these fields' values. I see two possible solutions to fix this behavior:
I would say, that the variant (1) is less intrusive, so I implemented it. No tests ever used non-zero values for begx/begy, so the tests weren't broken.