From 0807680edd94a7f14560831db4dd52e4e48d0d19 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 6 Dec 2016 23:34:16 +0200 Subject: [PATCH] Immediate update camera aspect in View::set_camera --- source/view.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/view.cpp b/source/view.cpp index 115a4b0c..1518b6ee 100644 --- a/source/view.cpp +++ b/source/view.cpp @@ -22,6 +22,8 @@ View::View(Graphics::Window &w, Graphics::GLContext &c): void View::set_camera(Camera *c) { camera = c; + if(camera) + camera->set_aspect(static_cast(window.get_width())/window.get_height()); } void View::set_content(Renderable *r) -- 2.45.2