1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 06:24:32 +00:00

Improve camera zooming behavior + camera related cleanups

- Now, the camera will now no longer be pulled towards the upper left
  or lower rigtht corner.
- cameraPos was never used as an interpolating vector, cleaned up related code.
- Core::invGlobalScale is now updated whenever Core::globalScale is changed
  (Not a nice solution but it does work)
- Increase cull radius by 10%, should prevent tiles from disappearing when
  zoomed in a lot.
This commit is contained in:
fgenesis 2014-03-07 17:59:36 +01:00
parent b501ba67e3
commit 2cec85fd05
11 changed files with 50 additions and 119 deletions

View file

@ -2960,6 +2960,7 @@ void SceneEditor::toggle(bool on)
core->cameraPos.x += cameraOffset * core->getVirtualWidth()/2;
core->cameraPos.y += cameraOffset * core->getVirtualHeight()/2;
core->globalScale = zoom;
core->globalScaleChanged();
}
else
{
@ -3230,6 +3231,7 @@ void SceneEditor::update(float dt)
if (zoom.x < 0.04f)
zoom.x = zoom.y = 0.04f;
core->globalScale = zoom;
core->globalScaleChanged();
if (zoom.x != oldZoom.x)
{
const float mouseX = core->mouse.position.x;