]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Properly move the image when zooming with the mouse wheel (basically the same bug...
authorterencehill <piuntn@gmail.com>
Sun, 14 Aug 2011 17:27:33 +0000 (19:27 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 14 Aug 2011 17:27:33 +0000 (19:27 +0200)
qcsrc/menu/item/image.c

index 7730741329646a07be9604294643918ca89a418f..1d94381a54dc25697aaa0d1459ad392e499bf060 100644 (file)
@@ -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);