core: Fix avm2 button bounding box when using scroll rects
This commit is contained in:
parent
3117469e20
commit
5e1a30cf4a
|
@ -1153,7 +1153,7 @@ pub trait TDisplayObject<'gc>:
|
|||
/// the overall AABB.
|
||||
fn bounds_with_transform(&self, matrix: &Matrix) -> Rectangle<Twips> {
|
||||
// A scroll rect completely overrides an object's bounds,
|
||||
// and can even the bounding box to be larger than the actual content
|
||||
// and can even grow the bounding box to be larger than the actual content
|
||||
if let Some(scroll_rect) = self.scroll_rect() {
|
||||
return *matrix
|
||||
* Rectangle {
|
||||
|
|
|
@ -620,8 +620,17 @@ impl<'gc> TDisplayObject<'gc> for Avm2Button<'gc> {
|
|||
}
|
||||
|
||||
fn bounds_with_transform(&self, matrix: &Matrix) -> Rectangle<Twips> {
|
||||
// [NA]: The diff between this and the base impl is a lack of scroll_rect.
|
||||
// Intentional, or bug?
|
||||
// A scroll rect completely overrides an object's bounds,
|
||||
// and can even grow the bounding box to be larger than the actual content
|
||||
if let Some(scroll_rect) = self.scroll_rect() {
|
||||
return *matrix
|
||||
* Rectangle {
|
||||
x_min: Twips::ZERO,
|
||||
y_min: Twips::ZERO,
|
||||
x_max: scroll_rect.width(),
|
||||
y_max: scroll_rect.height(),
|
||||
};
|
||||
}
|
||||
|
||||
// Get self bounds
|
||||
let mut bounds = *matrix * self.self_bounds();
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -0,0 +1,2 @@
|
|||
frame 1: (x=0, y=0, w=100, h=100)
|
||||
frame 2: (x=0, y=0, w=100, h=100)
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
num_ticks = 3
|
||||
|
||||
[image_comparisons.output]
|
||||
tolerance = 0
|
||||
|
||||
[player_options]
|
||||
# Visual test will test the render bounds, whereas output test does the "normal" bounds
|
||||
with_renderer = { optional = true, sample_count = 1 }
|
Loading…
Reference in New Issue