diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index ef000297f..3370fd25c 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -438,7 +438,7 @@ void CFrameBuffer::paletteSet(struct fb_cmap *map) void CFrameBuffer::paintHLineRelInternal2Buf(const int& x, const int& dx, const int& y, const int& box_dx, const fb_pixel_t& col, fb_pixel_t* buf) { - uint8_t * pos = ((uint8_t *)buf) + x * sizeof(fb_pixel_t) + box_dx * sizeof(fb_pixel_t) * y; + fb_pixel_t * pos = buf + x + box_dx * y; fb_pixel_t * dest = (fb_pixel_t *)pos; for (int i = 0; i < dx; i++) *(dest++) = col; @@ -639,11 +639,11 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int void CFrameBuffer::paintVLineRelInternal(int x, int y, int dy, const fb_pixel_t col) { - uint8_t * pos = ((uint8_t *)getFrameBufferPointer()) + x * sizeof(fb_pixel_t) + stride * y; + fb_pixel_t *pos = getFrameBufferPointer() + x + swidth * y; for(int count=0;count