[MSPAINT] Refactor updateCanvasAndScrollbars
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Mon, 23 Dec 2019 19:30:25 +0000 (04:30 +0900)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Mon, 23 Dec 2019 19:30:25 +0000 (04:30 +0900)
base/applications/mspaint/imgarea.cpp

index 74bf844..b31f764 100644 (file)
@@ -20,7 +20,11 @@ void
 updateCanvasAndScrollbars()
 {
     selectionWindow.ShowWindow(SW_HIDE);
-    imageArea.MoveWindow(3, 3, imageModel.GetWidth() * toolsModel.GetZoom() / 1000, imageModel.GetHeight() * toolsModel.GetZoom() / 1000, FALSE);
+
+    int zoomedWidth = imageModel.GetWidth() * toolsModel.GetZoom() / 1000;
+    int zoomedHeight = imageModel.GetHeight() * toolsModel.GetZoom() / 1000;
+    imageArea.MoveWindow(3, 3, zoomedWidth, zoomedHeight, FALSE);
+
     scrollboxWindow.Invalidate(TRUE);
     imageArea.Invalidate(FALSE);