From: terencehill Date: Sun, 14 Aug 2011 17:27:33 +0000 (+0200) Subject: Properly move the image when zooming with the mouse wheel (basically the same bug... X-Git-Tag: xonotic-v0.8.0~139^2~1^2~155^2~24 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=57c86b408f0d7458341cf2f7130f31b5a9a58058;p=xonotic%2Fxonotic-data.pk3dir.git Properly move the image when zooming with the mouse wheel (basically the same bug fixed in d657aa2190fd4ae62e92c2f02ba60c11285de97d) --- diff --git a/qcsrc/menu/item/image.c b/qcsrc/menu/item/image.c index 773074132..1d94381a5 100644 --- a/qcsrc/menu/item/image.c +++ b/qcsrc/menu/item/image.c @@ -160,7 +160,10 @@ void Image_setZoom(entity me, float z, float atMousePosition) me.zoomFactor = z; me.zoomFactor = bound(1/16, me.zoomFactor, 16); if (atMousePosition && prev_zoomFactor != me.zoomFactor) - me.zoomOffset = me.start_zoomOffset + (me.start_coords - '0.5 0.5 0') * (1/prev_zoomFactor); + { + me.zoomOffset_x = me.start_zoomOffset_x + (me.start_coords_x - 0.5) / me.imgSize_x; + me.zoomOffset_y = me.start_zoomOffset_y + (me.start_coords_y - 0.5) / me.imgSize_y; + } if (prev_zoomFactor != me.zoomFactor) me.zoomTime = time; me.updateAspect(me);