Unverified Commit 0ce15f6b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

winwidget_center_image: do not hardcode x/y = 0

Previously, the zoom_fit / zoom_fill actions would place an image in a
non-fullscreen setting at the top-left corner (x/y = 0) if the window was
larger than required.

Now, the image is centered correctly.
parent 856cb97e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1118,11 +1118,11 @@ void winwidget_center_image(winwidget winwid)
		if (opt.geom_flags & WidthValue)
			winwid->im_x = ((int)opt.geom_w - lround(winwid->im_w * winwid->zoom)) >> 1;
		else
			winwid->im_x = 0;
			winwid->im_x = (int) (winwid->w - lround(winwid->im_w * winwid->zoom)) >> 1;
		if (opt.geom_flags & HeightValue)
			winwid->im_y = ((int)opt.geom_h - lround(winwid->im_h * winwid->zoom)) >> 1;
		else
			winwid->im_y = 0;
			winwid->im_y = (int) (winwid->h - lround(winwid->im_h * winwid->zoom)) >> 1;
	}
}