lel

Fork of Hiltjo's Farbfeld image viewer. (It was just for fun, not much use)
Log | Files | Refs | README | LICENSE

commit 4bbceac600c004c4c9967e827c763667a94c989f
parent 4d2dac24171ef1aa102ce20a4a26a77d0fc3d298
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Sun, 18 Apr 2021 14:15:52 -0700

Treat FULL_STRECH normally in draw

There isn't any reason for pan offsets to be ignored for this view.
Also remove redundent variable initialization.

Diffstat:
Mlel.c | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lel.c b/lel.c @@ -274,16 +274,16 @@ scaleview(void) static void draw(void) { - int xoffset = 0, yoffset = 0; - - if (viewmode != FULL_STRETCH) { - /* center vertical, horizontal */ - xoffset = (winwidth - ximg->width) / 2; - yoffset = (winheight - ximg->height) / 2; - /* pan offset */ - xoffset -= img.view.panxoffset; - yoffset -= img.view.panyoffset; - } + int xoffset, yoffset; + + /* center vertical, horizontal */ + xoffset = (winwidth - ximg->width) / 2; + yoffset = (winheight - ximg->height) / 2; + + /* pan offset */ + xoffset -= img.view.panxoffset; + yoffset -= img.view.panyoffset; + XSetForeground(dpy, gc, bg.pixel); XFillRectangle(dpy, xpix, gc, 0, 0, winwidth, winheight); XPutImage(dpy, xpix, gc, ximg, 0, 0, xoffset, yoffset, ximg->width, ximg->height);