diff Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp @ 1576:92fca2b3ba3d

sanitizing the handling of canvas size
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Sep 2020 16:40:30 +0200
parents b4ccd4963d37
children 5887a4f8594b
line wrap: on
line diff
--- a/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp	Wed Sep 23 17:25:25 2020 +0200
+++ b/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp	Thu Sep 24 16:40:30 2020 +0200
@@ -176,7 +176,8 @@
                        (event.window.event == SDL_WINDOWEVENT_SHOWN ||
                         event.window.event == SDL_WINDOWEVENT_EXPOSED))
               {
-                paint = true;
+                std::unique_ptr<OrthancStone::IViewport::ILock> lock(viewport->Lock());
+                lock->RefreshCanvasSize();
               }
               else if (event.type == SDL_KEYDOWN &&
                        event.key.repeat == 0 /* Ignore key bounce */)