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:
authorCampbell Barton <ideasman42@gmail.com>2013-12-11 05:42:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-11 06:07:00 +0400
commit5afc2a9a4457b99be29dde1af1f2deda3de186f3 (patch)
treee3758c963ac808f5d407d93e7c16aeba29baa0b8 /source/blender/windowmanager/intern/wm_subwindow.c
parent9bca996c5e69ff546547e0314b17cd4abfa25fb1 (diff)
Code cleanup: assign win size to const vars and some renaming
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);