From 70fb40ea5aa0552f547cd12ff4c80f0f9f17a77f Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 15 Mar 2021 01:36:14 -0400 Subject: [PATCH] [pixel] derivce location for raster from plane --- src/lib/internal.h | 4 +--- src/lib/render.c | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/internal.h b/src/lib/internal.h index 203075430..48e8362b4 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -350,9 +350,7 @@ typedef struct ncpile { typedef struct sprixel { char* glyph; // glyph; can be quite large int id; // embedded into glusters field of nccell - int y, x; // position relative to the standard plane - int cols; - int rows; + ncplane* n; // associated ncplane, provides location and size int invalidated; struct sprixel* next; } sprixel; diff --git a/src/lib/render.c b/src/lib/render.c index 3c2273018..13b87f4f1 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -922,7 +922,9 @@ static int rasterize_sprixels(notcurses* nc, FILE* out){ for(sprixel* s = nc->sprixelcache ; s ; s = s->next){ if(s->invalidated){ - if(goto_location(nc, out, s->y, s->x)){ + int y, x; + ncplane_yx(s->n, &y, &x); + if(goto_location(nc, out, y, x)){ return -1; } if(ncfputs(s->glyph, out) < 0){