-
-
Notifications
You must be signed in to change notification settings - Fork 882
AVM2: Fix a plethora of hitTest issues #8744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… not the child This fixes ingame menu buttons in BLOCnog
I was hoping that this would fix https://z0r.de/L/z0r-de_6516.swf as well. |
This should be fixed now |
render/src/bounding_box.rs
Outdated
@@ -11,6 +11,14 @@ pub struct BoundingBox { | |||
} | |||
|
|||
impl BoundingBox { | |||
/// Create a zero-sized, valid BoundingBox | |||
pub fn empty() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about make a custom impl Default that sets valid to true?
As an all-zero BoundingBox should be implicitly valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried doing this originally, however it causes some of our tests to fail. (Also this change isn't needed now that avm2 buttons overload bounds_with_transform
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
however it causes some of our tests to fail
Oh, that's even weirder I think. Recently I was thinking that valid
is actually redundant and just equivalent to doing validity check manually each time.
OK, I think I understand most parts of it, but the ones with SimpleButton using its child's transform sounds very weird - at least, if SimpleButton was implemented purely in AS, this couldn't have happened. It's possible that indeed FP is weird like that (not the first time), but this might also indicate that something in button's tree might be implemented wrong. Hence, pinging @kmeisthax just for a second opinion. |
Oh, and one more thing, do you think you could write some AS-only tests for this? Maybe not the mouse pick, but the hit tests should be doable. If you need help, I can try write them for you. |
AS3 Keep in mind that I'm not entirely sure it's even possible to implement a "pure AS We actually have test coverage for the AS3-side parent field in
I don't quite remember the justification for that last behavior, though - it was actually written by @Herschel. I'm assuming it's to keep inactive states from seeing |
It appears this unintentionally impacted AVM1 and caused #9274. |
This fixes a number of issues related to
hitTestObject
,hitTestPoint
andmouse_pick
behavior.Fixes:
Todos: