mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 01:20:17 +00:00
Fix problem detecting Timeline widgets when it's hidden
This commit is contained in:
parent
7b0013d5a1
commit
835fe40540
@ -408,16 +408,18 @@ Widget* Widget::getPreviousSibling()
|
||||
return *(++it);
|
||||
}
|
||||
|
||||
Widget* Widget::pick(const gfx::Point& pt)
|
||||
Widget* Widget::pick(const gfx::Point& pt, bool checkParentsVisibility)
|
||||
{
|
||||
Widget* inside, *picked = nullptr;
|
||||
|
||||
if (!hasFlags(HIDDEN) && // Is visible
|
||||
getBounds().contains(pt)) { // The point is inside the bounds
|
||||
// isVisible() checks visibility of widget's parent.
|
||||
if (((checkParentsVisibility && isVisible()) ||
|
||||
(!checkParentsVisibility && !hasFlags(HIDDEN))) &&
|
||||
(getBounds().contains(pt))) {
|
||||
picked = this;
|
||||
|
||||
for (Widget* child : m_children) {
|
||||
inside = child->pick(pt);
|
||||
inside = child->pick(pt, false);
|
||||
if (inside) {
|
||||
picked = inside;
|
||||
break;
|
||||
|
@ -184,7 +184,7 @@ namespace ui {
|
||||
Widget* getNextSibling();
|
||||
Widget* getPreviousSibling();
|
||||
|
||||
Widget* pick(const gfx::Point& pt);
|
||||
Widget* pick(const gfx::Point& pt, bool checkParentsVisibility = true);
|
||||
bool hasChild(Widget* child);
|
||||
bool hasAncestor(Widget* ancestor);
|
||||
Widget* findChild(const char* id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user