Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/window.cpp
- ===================================================================
- --- src/window.cpp (révision 22967)
- +++ src/window.cpp (copie de travail)
- @@ -1248,6 +1248,7 @@
- int16 default_width = max(desc->default_width, sm_width);
- int16 default_height = max(desc->default_height, sm_height);
- + int16 min_y;
- if (desc->parent_cls != 0 /* WC_MAIN_WINDOW */ &&
- (w = FindWindowById(desc->parent_cls, window_number)) != NULL &&
- @@ -1266,7 +1267,17 @@
- return GetToolbarAlignedWindowPosition(default_width);
- case WDP_AUTO: // Find a good automatic position for the window
- - return GetAutoPlacePosition(default_width, default_height);
- + // Center on cursor
- + pt.x = _cursor.draw_pos.x - (default_width / 2);
- + pt.y = _cursor.draw_pos.y - (default_height / 2);
- + w = FindWindowById(WC_MAIN_TOOLBAR, 0);
- + if (w != NULL && (pt.x + default_width) > w->left && pt.x < (w->left + w->width))
- + min_y = w->height;
- + else
- + min_y = 0;
- + if (pt.y < min_y)
- + pt.y = min_y;
- + break;
- case WDP_CENTER: // Centre the window horizontally
- pt.x = (_screen.width - default_width) / 2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement