mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
fbcon: properly place bitmaps
This commit is contained in:
parent
d2cf43d087
commit
cf5e98c6cd
@ -92,10 +92,10 @@ int fbcon_draw(const struct ncpile *p, sprixel* s, FILE* out, int y, int x){
|
|||||||
const tinfo* ti = &p->nc->tcache;
|
const tinfo* ti = &p->nc->tcache;
|
||||||
for(int l = 0 ; l < s->pixy ; ++l){
|
for(int l = 0 ; l < s->pixy ; ++l){
|
||||||
// FIXME pixel size isn't necessarily 4B, line isn't necessarily psize*pixx
|
// FIXME pixel size isn't necessarily 4B, line isn't necessarily psize*pixx
|
||||||
size_t offset = ((l + y) * ti->pixx + x) * 4;
|
size_t offset = ((l + y * ti->cellpixy) * ti->pixx + x * ti->cellpixx) * 4;
|
||||||
size_t lsize = s->pixx * 4;
|
|
||||||
uint8_t* tl = ti->linux_fbuffer + offset;
|
uint8_t* tl = ti->linux_fbuffer + offset;
|
||||||
const char* src = s->glyph + (l * s->pixx * 4);
|
const char* src = s->glyph + (l * s->pixx * 4);
|
||||||
|
size_t lsize = s->pixx * 4;
|
||||||
memcpy(tl, src, lsize);
|
memcpy(tl, src, lsize);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user