onMouseButtonLeft :: Double -> Double -> AppController -> IO AppController
onMouseButtonLeft x y app =
  let w          = appWidth app
      h          = appHeight app
      cz         = appZoom app
      czf        = appZoomFactor app
      (rx :+ ry) = toCart w h (x :+ y)
      (nx,ny)    = (appX app + rx/cz,appY app + ry/cz)
      newZ       = cz * czf
  in return app { appX = nx, appY = ny, appZoom = newZ }

onMouseButtonLeft :: Double -> Double -> AppController -> IO AppController
onMouseButtonLeft x y app =
  let w          = appWidth app
      h          = appHeight app
      cz         = appZoom app
      czf        = appZoomFactor app
      (rx :+ ry) = toCart w h (x :+ y)
      (nx,ny)    = (appX app + rx/cz,appY app + ry/cz)
      newZ       = cz * czf
  in return app { appX = nx, appY = ny, appZoom = newZ }
onMouseButtonLeft x y app =
  let w          = appWidth app
      h          = appHeight app
      cz         = appZoom app
      czf        = appZoomFactor app
      (rx :+ ry) = toCart w h (x :+ y)
      (nx,ny)    = (appX app + rx/cz,appY app + ry/cz)
      newZ       = cz * czf
  in return app { appX = nx, appY = ny, appZoom = newZ }