turns out one of those calls were necessary to prevent image from being

scaled down too far, this commit fixes the last commit while preserving
the speed improvement by preventing a call to drawimage() through an X11 event after image size has been changed.
This commit is contained in:
speedie 2023-03-08 19:10:48 +01:00
parent 08b54267ae
commit 03a245720e
2 changed files with 11 additions and 0 deletions

View file

@ -17,6 +17,10 @@ setimagesize(int width, int height)
imageheight = height;
imagewidth = width;
drawimage();
needredraw = 0;
if (!image) {
imageheight = oih;
imagewidth = oiw;
@ -69,6 +73,12 @@ drawimage(void)
if (!lines || hideimage) return;
/* to prevent the image from being drawn multiple times */
if (!needredraw) {
needredraw = 1;
return;
}
if (sel && sel->image && strcmp(sel->image, limg ? limg : "")) {
if (longestedge)
loadimagecache(sel->image, &width, &height);

View file

@ -159,6 +159,7 @@ static int rotation = 0;
static int imagew = 0;
static int imageh = 0;
static int imageg = 0;
static int needredraw = 1;
/* set an integer if to 1 if we have right to left language support enabled
* doing it this way, because we can reduce the amount of #if and #else lines used.