core: Fix avm2button bounding box

This commit is contained in:
Nathan Adams 2023-06-20 22:55:10 +02:00
parent 18fb5064d3
commit 6b76af2d40
6 changed files with 22 additions and 1 deletions

View File

@ -617,7 +617,8 @@ impl<'gc> TDisplayObject<'gc> for Avm2Button<'gc> {
// Add the bounds of the child, dictated by current state
let state = self.0.read().state;
if let Some(child) = self.get_state_child(state.into()) {
let child_bounds = child.bounds_with_transform(matrix);
let matrix = *matrix * *child.base().matrix();
let child_bounds = child.bounds_with_transform(&matrix);
bounds = bounds.union(&child_bounds);
}

View File

@ -0,0 +1,14 @@
package {
import flash.display.MovieClip;
public class Test extends MovieClip {
public function Test() {
trace(button.getBounds(this));
}
}
}

View File

@ -0,0 +1 @@
(x=188.8, y=112.6, w=91.64999999999998, h=21.200000000000017)

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
num_frames = 1
[approximations]
number_patterns = ["\\(x=(.+?), y=(.+?), w=(.+?), h=(.+?)\\)"]
epsilon = 0.01