Skip to content

Commit

Permalink
Fix annoying bug
Browse files Browse the repository at this point in the history
  • Loading branch information
johnBuffer committed Dec 16, 2021
1 parent e4e77e3 commit 3d04cd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/common/viewport_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ struct ViewportHandler
const float zoom_amount = 1.2f;
const float delta = w > 0 ? zoom_amount : 1.0f / zoom_amount;
zoom(delta);
} else {
zoom(1.0f);
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/editor/editor_scene.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ struct EditorScene : public GUI::Scene
void onSizeChange() override
{
renderer->setSize(root.size);
simulation.renderer.vp_handler.wheelZoom(0);
renderer->simulation.renderer.vp_handler.state.center = root.size;
// This is to update mouse_position
simulation.renderer.vp_handler.wheelZoom(0);
}
};

Expand Down

0 comments on commit 3d04cd9

Please sign in to comment.