Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_subwindow.c')
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index ae535ed45e8..75608a850ac 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -209,6 +209,9 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
wmSubWindow *swin = swin_from_swinid(win, swinid);
if (swin) {
+ const int winsize_x = WM_window_pixels_x(win);
+ const int winsize_y = WM_window_pixels_y(win);
+
int width, height;
swin->winrct = *winrct;
@@ -226,10 +229,10 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
* fixed it). - zr (2001!)
*/
- if (swin->winrct.xmax > WM_window_pixels_x(win))
- swin->winrct.xmax = WM_window_pixels_x(win);
- if (swin->winrct.ymax > WM_window_pixels_y(win))
- swin->winrct.ymax = WM_window_pixels_y(win);
+ if (swin->winrct.xmax > winsize_x)
+ swin->winrct.xmax = winsize_x;
+ if (swin->winrct.ymax > winsize_y)
+ swin->winrct.ymax = winsize_y;
/* extra service */
wmSubWindowSet(win, swinid);