-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Handle begy/begx and leny/lenx #2819
base: master
Are you sure you want to change the base?
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.