core: Don't invalidate self on changing visibility

This commit is contained in:
Nathan Adams 2023-07-20 00:17:27 +02:00
parent 1fd8ca7bad
commit b6a8e0a471
1 changed files with 4 additions and 1 deletions

View File

@ -1549,7 +1549,10 @@ pub trait TDisplayObject<'gc>:
/// Returned by the `_visible`/`visible` ActionScript properties.
fn set_visible(&self, gc_context: MutationContext<'gc, '_>, value: bool) {
if self.base_mut(gc_context).set_visible(value) {
self.invalidate_cached_bitmap(gc_context);
if let Some(parent) = self.parent() {
// We don't need to invalidate ourselves, we're just toggling if it's rendered.
parent.invalidate_cached_bitmap(gc_context);
}
}
}