Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/src/display_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,11 +940,17 @@ pub fn render_base<'gc>(
let cache_info = if context.use_bitmap_cache && this.is_bitmap_cached() {
let mut cache_info: Option<DrawCacheInfo> = None;
let base_transform = context.transform_stack.transform();
let bounds: Rectangle<Twips> = this.render_bounds_with_transform(
let mut bounds: Rectangle<Twips> = this.render_bounds_with_transform(
&base_transform.matrix,
false, // we want to do the filter growth for this object ourselves, to know the offsets
&context.stage.view_matrix(),
);
bounds = Rectangle {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can add a method to rectangle that does that

x_min: Twips::from_pixels(bounds.x_min.to_pixels().round()),
x_max: Twips::from_pixels(bounds.x_max.to_pixels().round()),
y_min: Twips::from_pixels(bounds.y_min.to_pixels().round()),
y_max: Twips::from_pixels(bounds.y_max.to_pixels().round()),
};
let name = this.name();
let mut filters: Vec<Filter> = this.filters().to_owned();
let swf_version = this.swf_version();
Expand Down Expand Up @@ -1379,6 +1385,9 @@ pub trait TDisplayObject<'gc>:

if let Some(ctr) = self.as_container() {
for child in ctr.iter_render_list() {
if !child.visible() {
continue;
}
let matrix = *matrix * child.base().matrix();
bounds =
bounds.union(&child.render_bounds_with_transform(&matrix, true, view_matrix));
Expand Down
Loading