diff --git a/NEWS.md b/NEWS.md index 55c8cb843f..a5d4cc5acc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/doc/man/man3/notcurses_render.3.md b/doc/man/man3/notcurses_render.3.md index 3c33997ac9..f02f228e57 100644 --- a/doc/man/man3/notcurses_render.3.md +++ b/doc/man/man3/notcurses_render.3.md @@ -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 diff --git a/src/lib/render.c b/src/lib/render.c index 646f989db1..00f6a9869b 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -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; }