chore: cargo fmt pass

This commit is contained in:
Mike Welsh 2019-09-06 15:19:59 -07:00
parent ae10092c97
commit 545af9379a
3 changed files with 19 additions and 11 deletions

View File

@ -162,8 +162,7 @@ impl<'gc> DisplayObject<'gc> for Button<'gc> {
Ok(child) => {
{
let mut child = child.write(context.gc_context);
child
.set_matrix(&record.matrix.clone().into());
child.set_matrix(&record.matrix.clone().into());
child.set_parent(Some(context.active_clip));
}
self.hit_area.insert(record.depth, child);

View File

@ -348,14 +348,20 @@ impl<Audio: AudioBackend, Renderer: RenderBackend> Player<Audio, Renderer> {
};
let mut morph_shapes = fnv::FnvHashMap::default();
gc_root.root.write(gc_context).as_movie_clip_mut().unwrap().preload(&mut update_context, &mut morph_shapes);
gc_root
.root
.write(gc_context)
.as_movie_clip_mut()
.unwrap()
.preload(&mut update_context, &mut morph_shapes);
// Finalize morph shapes.
for (id, static_data) in morph_shapes {
let morph_shape = crate::morph_shape::MorphShape::new(gc_context, static_data);
update_context
.library
.register_character(id, crate::character::Character::MorphShape(Box::new(morph_shape)));
update_context.library.register_character(
id,
crate::character::Character::MorphShape(Box::new(morph_shape)),
);
}
});
}

View File

@ -13,11 +13,14 @@ impl<'gc> Text<'gc> {
pub fn from_swf_tag(context: &mut UpdateContext<'_, 'gc, '_>, tag: &swf::Text) -> Self {
Self {
base: Default::default(),
static_data: gc_arena::Gc::allocate(context.gc_context, TextStatic {
id: tag.id,
text_transform: tag.matrix.clone().into(),
text_blocks: tag.records.clone(),
})
static_data: gc_arena::Gc::allocate(
context.gc_context,
TextStatic {
id: tag.id,
text_transform: tag.matrix.clone().into(),
text_blocks: tag.records.clone(),
},
),
}
}
}