Skip to content

Commit

Permalink
notcurses_at_yx: return EGC for any column of wide glyph #1490
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed May 29, 2021
1 parent fadc3b6 commit 7b72ef5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ rearrangements of Notcurses.
* `ncplane_at_yx()` now returns the EGC when called on any column of a
wide glyph. `ncplane_at_yx_cell()` continues to duplicate the exact
`nccell`, and can thus continue to be used to distinguish between primary
and secondary columns of a wide glyph.
and secondary columns of a wide glyph. Likewise, `notcurses_at_yx()`
now returns the EGC when called on any column of a wide glyph.

* 2.3.1 (2021-05-18)
* Sprixels no longer interact with their associated plane's framebuffer. This
Expand Down
5 changes: 3 additions & 2 deletions doc/man/man3/notcurses_render.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ If the algorithm concludes without an EGC, the cell is rendered with no glyph
and a default background. If the algorithm concludes without a color locked in,
the color as computed thus far is used.

**notcurses_at_yx** retrieves a call *as rendered*. The EGC in that cell is
copied and returned; it must be **free(3)**d by the caller.
**notcurses_at_yx** retrieves a cell *as rendered*. The EGC in that cell is
copied and returned; it must be **free(3)**d by the caller. If the cell is a
secondary column of a wide glyph, the glyph is still returned.

# RETURN VALUES

Expand Down
3 changes: 3 additions & 0 deletions src/lib/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,9 @@ char* notcurses_at_yx(notcurses* nc, int yoff, int xoff, uint16_t* stylemask, ui
if(yoff >= 0 && yoff < nc->lfdimy){
if(xoff >= 0 || xoff < nc->lfdimx){
const nccell* srccell = &nc->lastframe[yoff * nc->lfdimx + xoff];
if(nccell_wide_right_p(srccell)){
return notcurses_at_yx(nc, yoff, xoff - 1, stylemask, channels);
}
if(stylemask){
*stylemask = srccell->stylemask;
}
Expand Down

0 comments on commit 7b72ef5

Please sign in to comment.