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:
parent
08b54267ae
commit
03a245720e
10
libs/img.c
10
libs/img.c
|
@ -17,6 +17,10 @@ setimagesize(int width, int height)
|
||||||
imageheight = height;
|
imageheight = height;
|
||||||
imagewidth = width;
|
imagewidth = width;
|
||||||
|
|
||||||
|
drawimage();
|
||||||
|
|
||||||
|
needredraw = 0;
|
||||||
|
|
||||||
if (!image) {
|
if (!image) {
|
||||||
imageheight = oih;
|
imageheight = oih;
|
||||||
imagewidth = oiw;
|
imagewidth = oiw;
|
||||||
|
@ -69,6 +73,12 @@ drawimage(void)
|
||||||
|
|
||||||
if (!lines || hideimage) return;
|
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 (sel && sel->image && strcmp(sel->image, limg ? limg : "")) {
|
||||||
if (longestedge)
|
if (longestedge)
|
||||||
loadimagecache(sel->image, &width, &height);
|
loadimagecache(sel->image, &width, &height);
|
||||||
|
|
1
spmenu.c
1
spmenu.c
|
@ -159,6 +159,7 @@ static int rotation = 0;
|
||||||
static int imagew = 0;
|
static int imagew = 0;
|
||||||
static int imageh = 0;
|
static int imageh = 0;
|
||||||
static int imageg = 0;
|
static int imageg = 0;
|
||||||
|
static int needredraw = 1;
|
||||||
|
|
||||||
/* set an integer if to 1 if we have right to left language support enabled
|
/* 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.
|
* doing it this way, because we can reduce the amount of #if and #else lines used.
|
||||||
|
|
Loading…
Reference in a new issue