kill off-by-one in pixel scaling #1558

pull/1567/head
nick black 3 years ago
parent 6a509328fa
commit 67bac13f67
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -665,10 +665,10 @@ ncplane* ncvisual_render_pixels(notcurses* nc, ncvisual* ncv, const struct blits
disprows *= nc->tcache.cellpixy;
clamp_to_sixelmax(&nc->tcache, &disprows, &dispcols);
if(!(flags & NCVISUAL_OPTION_HORALIGNED)){
dispcols -= (placex * nc->tcache.cellpixx + 1);
dispcols -= placex * nc->tcache.cellpixx;
}
if(!(flags & NCVISUAL_OPTION_VERALIGNED)){
disprows -= (placey * nc->tcache.cellpixy + 1);
disprows -= placey * nc->tcache.cellpixy;
}
}
}

@ -70,7 +70,7 @@ TEST_CASE("Bitmaps") {
.userptr = nullptr, .name = "bigp", .resizecb = nullptr,
.flags = 0, .margin_b = 0, .margin_r = 0,
};
vopts.scaling = NCSCALE_STRETCH;
vopts.scaling = NCSCALE_SCALE;
vopts.n = ncplane_create(n_, &nopts);
REQUIRE(vopts.n);
uint64_t white = CHANNELS_RGB_INITIALIZER(0xff, 0xff, 0xff, 0xff, 0xff, 0xff);

Loading…
Cancel
Save