This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
When adding Joystick as a child of an element it no longer behaves correctly #9
Labels
bug
Something isn't working
Description
When adding Joystick as a child of a Visual Element with the intention of to be a bounding area for the joystick to exist, I've found that the logic does not take into account the joystick rect position and the subsequent mouse position relative to the joystick rect
The Idea being that the joystick would appear only in the highlighted area
Environment
Steps to reproduce
This can be reproduced in the sample test document by adding two Visual Elements and setting the Joystick as a child of the second with any alignment
Expected behaviour
Joystick should remain within the bounds relative to the parent
Actual behaviour
Joystick moves itself outside of the container
Possible solutions
By considering position of the parent element when determining the bounding box and then the mouse position relative to the bounding rectangle, we can accurately check and set whether the mouse pointer is within the range of the rectangle and ensure that the inner joystick's bounds are contained within the joystick element.
The text was updated successfully, but these errors were encountered: