Loading

Paste #pxli2oboc

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

Comments