summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index d889b0c..084671a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,7 +36,7 @@ int main() {
if (event.has_value()) {
sf::Event e = event.value();
ImGui::SFML::ProcessEvent(window, e);
- editor.update(e);
+ editor.update(e, window);
}
// (cv pasted from
@@ -45,7 +45,10 @@ int main() {
if (const auto* resized = event->getIf<sf::Event::Resized>()) {
// update the view to the new size of the window
sf::FloatRect visibleArea({0.f, 0.f}, sf::Vector2f(resized->size));
- window.setView(sf::View(visibleArea));
+ sf::View view(visibleArea);
+ view.setCenter(window.getView().getCenter());
+ view.zoom(editor.get_zoom());
+ window.setView(view);
}
if (event->is<sf::Event::Closed>()) {