File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
base/applications/mspaint Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,14 @@ void CImgAreaWindow::drawZoomFrame(int mouseX, int mouseY)
41
41
int x, y, w, h;
42
42
scrollboxWindow.GetClientRect (&clientRectScrollbox);
43
43
GetClientRect (&clientRectImageArea);
44
- w = clientRectImageArea.right * clientRectScrollbox.right / (clientRectImageArea.right * 2 );
45
- h = clientRectImageArea.bottom * clientRectScrollbox.bottom / (clientRectImageArea.bottom * 2 );
44
+ w = clientRectImageArea.right * 2 ;
45
+ h = clientRectImageArea.bottom * 2 ;
46
+ if (!w || !h)
47
+ {
48
+ return ;
49
+ }
50
+ w = clientRectImageArea.right * clientRectScrollbox.right / w;
51
+ h = clientRectImageArea.bottom * clientRectScrollbox.bottom / h;
46
52
x = max (0 , min (clientRectImageArea.right - w, mouseX - w / 2 ));
47
53
y = max (0 , min (clientRectImageArea.bottom - h, mouseY - h / 2 ));
48
54
You can’t perform that action at this time.
0 commit comments