Fix behaviour when TrueColor / 24 bit depth is not available (#114)
* Fix regression introduced in c7ca547
which made nsxiv not start in
non-TrueColor X server.
* Introduce a new fix for embedding into tabbed-alpha.
* Fixes a visual glitch from original sxiv when drawing transparent images in 8
bit depth. In 8 bit PseudoColor, `.pixel` is just an index into the 256
defined colors and thus trying to extract rgb bits from it would result in
visual glitch. The values `.color.red` on the other hand and so on are always
integers between 0 and 0xFFFF representing the color as expected.
* Use XColor for win_bg/fg and mrk_fg
Co-authored-by: NRK <nrk@disroot.org>
This commit is contained in:
4
image.c
4
image.c
@ -577,7 +577,7 @@ void img_render(img_t *img)
|
||||
int sx, sy, sw, sh;
|
||||
int dx, dy, dw, dh;
|
||||
Imlib_Image bg;
|
||||
unsigned long c;
|
||||
XColor c;
|
||||
|
||||
win = img->win;
|
||||
img_fit(img);
|
||||
@ -646,7 +646,7 @@ void img_render(img_t *img)
|
||||
imlib_image_put_back_data(data);
|
||||
} else {
|
||||
c = win->win_bg;
|
||||
imlib_context_set_color(c >> 16 & 0xFF, c >> 8 & 0xFF, c & 0xFF, 0xFF);
|
||||
imlib_context_set_color(c.red >> 8, c.green >> 8, c.blue >> 8, 0xFF);
|
||||
imlib_image_fill_rectangle(0, 0, dw, dh);
|
||||
}
|
||||
imlib_blend_image_onto_image(img->im, 0, sx, sy, sw, sh, 0, 0, dw, dh);
|
||||
|
Reference in New Issue
Block a user