diff --git a/src/app/ui/brush_popup.cpp b/src/app/ui/brush_popup.cpp index 7f535f126..d7d1ee360 100644 --- a/src/app/ui/brush_popup.cpp +++ b/src/app/ui/brush_popup.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018 Igara Studio S.A. +// Copyright (C) 2018-2019 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -434,7 +434,7 @@ void BrushPopup::onBrushChanges() { if (isVisible()) { gfx::Region rgn; - getDrawableRegion(rgn, DrawableRegionFlags(kCutTopWindows | kUseChildArea)); + getDrawableRegion(rgn, kCutTopWindowsAndUseChildArea); regenerate(bounds()); invalidate(); diff --git a/src/ui/view.cpp b/src/ui/view.cpp index b6fdf1b74..8428e8894 100644 --- a/src/ui/view.cpp +++ b/src/ui/view.cpp @@ -266,8 +266,7 @@ void View::onSetViewScroll(const gfx::Point& pt) // Visible viewport region that is not overlapped by windows Region drawableRegion; - m_viewport.getDrawableRegion( - drawableRegion, DrawableRegionFlags(kCutTopWindows | kUseChildArea)); + m_viewport.getDrawableRegion(drawableRegion, kCutTopWindowsAndUseChildArea); // Start the region to scroll equal to the drawable viewport region. Rect cpos = m_viewport.childrenBounds(); diff --git a/src/ui/widget.h b/src/ui/widget.h index ec0368eff..2694d80e4 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -267,6 +267,7 @@ namespace ui { enum DrawableRegionFlags { kCutTopWindows = 1, // Cut areas where are windows on top. kUseChildArea = 2, // Use areas where are children. + kCutTopWindowsAndUseChildArea = kCutTopWindows | kUseChildArea, }; void getRegion(gfx::Region& region); diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 28ea48d0a..8cdc523e1 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -1,5 +1,5 @@ // Aseprite UI Library -// Copyright (C) 2018 Igara Studio S.A. +// Copyright (C) 2018-2019 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This file is released under the terms of the MIT license. @@ -590,8 +590,6 @@ void Window::limitSize(int* w, int* h) void Window::moveWindow(const gfx::Rect& rect, bool use_blit) { -#define FLAGS (DrawableRegionFlags)(kCutTopWindows | kUseChildArea) - Manager* manager = this->manager(); // Discard enqueued kWinMoveMessage for this window because we are @@ -614,7 +612,7 @@ void Window::moveWindow(const gfx::Rect& rect, bool use_blit) // Get the region & the drawable region of the window Region oldDrawableRegion; - getDrawableRegion(oldDrawableRegion, FLAGS); + getDrawableRegion(oldDrawableRegion, kCutTopWindowsAndUseChildArea); // If the size of the window changes... if (old_pos.w != rect.w || old_pos.h != rect.h) { @@ -630,7 +628,7 @@ void Window::moveWindow(const gfx::Rect& rect, bool use_blit) // Get the new drawable region of the window (it's new because we // moved the window to "rect") Region newDrawableRegion; - getDrawableRegion(newDrawableRegion, FLAGS); + getDrawableRegion(newDrawableRegion, kCutTopWindowsAndUseChildArea); // First of all, we have to find the manager region to invalidate, // it's the old window drawable region without the new window