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/editors/screen/area.c')
-rw-r--r--source/blender/editors/screen/area.c70
1 files changed, 14 insertions, 56 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 47c44468bc7..34a20c8ccf7 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -187,52 +187,6 @@ void ED_area_do_refresh(bContext *C, ScrArea *sa)
}
/**
- * Action zones are only updated if the mouse is inside of them, but in some cases (currently only fullscreen icon)
- * it might be needed to update their properties and redraw if the mouse isn't inside.
- */
-void ED_area_azones_update(ScrArea *sa, const int mouse_xy[2])
-{
- AZone *az;
- bool changed = false;
-
- for (az = sa->actionzones.first; az; az = az->next) {
- if (az->type == AZONE_FULLSCREEN) {
- /* only if mouse is not hovering the azone */
- if (BLI_rcti_isect_pt_v(&az->rect, mouse_xy) == false) {
- az->alpha = 0.0f;
- changed = true;
-
- /* can break since currently only this is handled here */
- break;
- }
- }
- else if (az->type == AZONE_REGION_SCROLL) {
- /* only if mouse is not hovering the azone */
- if (BLI_rcti_isect_pt_v(&az->rect, mouse_xy) == false) {
- View2D *v2d = &az->ar->v2d;
-
- if (az->direction == AZ_SCROLL_VERT) {
- az->alpha = v2d->alpha_vert = 0;
- changed = true;
- }
- else if (az->direction == AZ_SCROLL_HOR) {
- az->alpha = v2d->alpha_hor = 0;
- changed = true;
- }
- else {
- BLI_assert(0);
- }
- }
- }
- }
-
- if (changed) {
- sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE;
- ED_area_tag_redraw_no_rebuild(sa);
- }
-}
-
-/**
* \brief Corner widget use for quitting fullscreen.
*/
static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, float alpha)
@@ -412,18 +366,11 @@ static void region_draw_azones(ScrArea *sa, ARegion *ar)
}
else if (az->type == AZONE_FULLSCREEN) {
area_draw_azone_fullscreen(az->x1, az->y1, az->x2, az->y2, az->alpha);
-
- if (az->alpha != 0.0f) {
- area_azone_tag_update(sa);
- }
- }
- else if (az->type == AZONE_REGION_SCROLL) {
- if (az->alpha != 0.0f) {
- area_azone_tag_update(sa);
- }
- /* Don't draw this azone. */
}
}
+ if (!IS_EQF(az->alpha, 0.0f) && ELEM(az->type, AZONE_FULLSCREEN, AZONE_REGION_SCROLL)) {
+ area_azone_tag_update(sa);
+ }
}
GPU_matrix_pop();
@@ -1605,6 +1552,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
if (!(area->flag & AREA_FLAG_REGION_SIZE_UPDATE)) {
return;
}
+ const bScreen *screen = WM_window_get_active_screen(win);
WM_window_rect_calc(win, &window_rect);
area_calc_totrct(area, &window_rect);
@@ -1614,6 +1562,9 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
overlap_rect = rect;
region_rect_recursive(area, area->regionbase.first, &rect, &overlap_rect, 0);
+ /* Dynamically sized regions may have changed region sizes, so we have to force azone update. */
+ area_azone_initialize(win, screen, area);
+
for (ARegion *ar = area->regionbase.first; ar; ar = ar->next) {
region_subwindow(ar);
@@ -1621,7 +1572,11 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
if (ar->type->init) {
ar->type->init(wm, ar);
}
+
+ /* Some AZones use View2D data which is only updated in region init, so call that first! */
+ region_azones_add(screen, area, ar, ar->alignment & ~RGN_SPLIT_PREV);
}
+ ED_area_azones_update(area, &win->eventstate->x);
area->flag &= ~AREA_FLAG_REGION_SIZE_UPDATE;
}
@@ -2386,6 +2341,9 @@ void ED_region_panels_draw(const bContext *C, ARegion *ar)
/* set the view */
UI_view2d_view_ortho(v2d);
+ /* View2D matrix might have changed due to dynamic sized regions. */
+ UI_blocklist_update_window_matrix(C, &ar->uiblocks);
+
/* draw panels */
UI_panels_draw(C, ar);