Add z-index stacking for HTML UI widgets#120
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bool UIWidget::propagateOnMouseMove(const Point& mousePos, const Point& mouseMoved, UIWidgetList& widgetList) | ||
| { | ||
| if (containsPaddingPoint(mousePos)) { | ||
| for (const auto& child : m_children) { | ||
| const auto& orderedChildren = getChildrenInZOrder(); | ||
| for (const auto& child : orderedChildren) { | ||
| if (child->isExplicitlyVisible() && child->isExplicitlyEnabled() && child->containsPoint(mousePos)) | ||
| child->propagateOnMouseMove(mousePos, mouseMoved, widgetList); |
There was a problem hiding this comment.
Mouse move propagation ignores z-index order
Children are fetched via getChildrenInZOrder() but the loop runs forward, so lower z-index widgets handle mouse-move events before higher z-index siblings. When two widgets overlap and the lower z widget’s onMouseMove returns true, the visually top widget never sees the event, defeating the intent of the new stacking logic. Iterating the ordered list in reverse (as propagateOnMouseEvent does) would deliver mouse-move callbacks to the highest z child first.
Useful? React with 👍 / 👎.
|
This PR is stale because it has been open 45 days with no activity. |
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f9165ad52c832e8d4d04e694297bfa