mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-31 16:20:22 +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);
|
return *(++it);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget* Widget::pick(const gfx::Point& pt)
|
Widget* Widget::pick(const gfx::Point& pt, bool checkParentsVisibility)
|
||||||
{
|
{
|
||||||
Widget* inside, *picked = nullptr;
|
Widget* inside, *picked = nullptr;
|
||||||
|
|
||||||
if (!hasFlags(HIDDEN) && // Is visible
|
// isVisible() checks visibility of widget's parent.
|
||||||
getBounds().contains(pt)) { // The point is inside the bounds
|
if (((checkParentsVisibility && isVisible()) ||
|
||||||
|
(!checkParentsVisibility && !hasFlags(HIDDEN))) &&
|
||||||
|
(getBounds().contains(pt))) {
|
||||||
picked = this;
|
picked = this;
|
||||||
|
|
||||||
for (Widget* child : m_children) {
|
for (Widget* child : m_children) {
|
||||||
inside = child->pick(pt);
|
inside = child->pick(pt, false);
|
||||||
if (inside) {
|
if (inside) {
|
||||||
picked = inside;
|
picked = inside;
|
||||||
break;
|
break;
|
||||||
|
@ -184,7 +184,7 @@ namespace ui {
|
|||||||
Widget* getNextSibling();
|
Widget* getNextSibling();
|
||||||
Widget* getPreviousSibling();
|
Widget* getPreviousSibling();
|
||||||
|
|
||||||
Widget* pick(const gfx::Point& pt);
|
Widget* pick(const gfx::Point& pt, bool checkParentsVisibility = true);
|
||||||
bool hasChild(Widget* child);
|
bool hasChild(Widget* child);
|
||||||
bool hasAncestor(Widget* ancestor);
|
bool hasAncestor(Widget* ancestor);
|
||||||
Widget* findChild(const char* id);
|
Widget* findChild(const char* id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user