diff --git a/CorsixTH/Lua/game_ui.lua b/CorsixTH/Lua/game_ui.lua index 9bb0a4a..fe35f2a 100644 --- a/CorsixTH/Lua/game_ui.lua +++ b/CorsixTH/Lua/game_ui.lua @@ -102,7 +102,7 @@ function GameUI:makeVisibleDiamond(scr_w, scr_h) -- The visible diamond is the region which the top-left corner of the screen -- is limited to, and ensures that the map always covers all of the screen. - -- Its verticies are at (x + w, y), (x - w, y), (x, y + h), (x, y - h). + -- Its vertices are at (x + w, y), (x - w, y), (x, y + h), (x, y - h). return { x = - scr_w / 2, y = 16 * map_h - scr_h / 2, @@ -119,6 +119,7 @@ function GameUI:setZoom(factor) if not factor or math.abs(factor - 1) < 0.001 then factor = 1 end + print("factor " .. factor) local scr_w = self.app.config.width local scr_h = self.app.config.height local refx, refy = self.cursor_x or scr_w / 2, self.cursor_y or scr_h / 2 @@ -127,6 +128,7 @@ function GameUI:setZoom(factor) self.visible_diamond = self:makeVisibleDiamond(scr_w / factor, scr_h / factor) if self.visible_diamond.w < 0 or self.visible_diamond.h < 0 then self:setZoom(old_factor) + print("too zoomy") return false else cx, cy = self.app.map:WorldToScreen(cx, cy)