chore: cargo 1.47 changed the formatting algorithm

This commit is contained in:
David Wendt 2020-11-14 20:12:00 -05:00 committed by Mike Welsh
parent 365601f2d9
commit 8764831533
5 changed files with 34 additions and 18 deletions

View File

@ -10,8 +10,8 @@ use crate::avm2::value::Value;
use crate::avm2::Error;
use crate::context::UpdateContext;
use crate::display_object::{DisplayObject, TDisplayObject, TDisplayObjectContainer};
use gc_arena::{GcCell, MutationContext};
use enumset::EnumSet;
use gc_arena::{GcCell, MutationContext};
use std::cmp::min;
/// Implements `flash.display.DisplayObjectContainer`'s instance constructor.

View File

@ -26,7 +26,9 @@ mod text;
use crate::avm1::activation::Activation;
use crate::backend::input::MouseCursor;
pub use crate::display_object::container::{DisplayObjectContainer, TDisplayObjectContainer, Lists};
pub use crate::display_object::container::{
DisplayObjectContainer, Lists, TDisplayObjectContainer,
};
use crate::events::{ClipEvent, ClipEventResult};
pub use bitmap::Bitmap;
pub use button::Button;

View File

@ -5,13 +5,13 @@ use crate::display_object::button::Button;
use crate::display_object::movie_clip::MovieClip;
use crate::display_object::{Depth, DisplayObject, TDisplayObject};
use crate::string_utils::swf_string_eq_ignore_case;
use enumset::{EnumSet, EnumSetType};
use gc_arena::{Collect, MutationContext};
use ruffle_macros::enum_trait_object;
use enumset::{EnumSet, EnumSetType};
use std::cmp::Ordering;
use std::collections::BTreeMap;
use std::fmt::Debug;
use std::ops::{RangeBounds, Bound};
use std::ops::{Bound, RangeBounds};
/// The three lists that a display object container is supposed to maintain.
#[derive(EnumSetType)]
@ -569,7 +569,11 @@ impl<'gc> ChildContainer<'gc> {
None
}
} else if let Some((_, above_child)) = self.depth_list.range((Bound::Excluded(depth), Bound::Unbounded)).next() {
} else if let Some((_, above_child)) = self
.depth_list
.range((Bound::Excluded(depth), Bound::Unbounded))
.next()
{
let position = self
.render_list
.iter()
@ -669,7 +673,8 @@ impl<'gc> ChildContainer<'gc> {
child: DisplayObject<'gc>,
from_lists: EnumSet<Lists>,
) -> bool {
let removed_from_depth_list = from_lists.contains(Lists::Depth) && self.remove_child_from_depth_list(child);
let removed_from_depth_list =
from_lists.contains(Lists::Depth) && self.remove_child_from_depth_list(child);
let removed_from_render_list = if from_lists.contains(Lists::Render) {
let render_list_position = self
@ -689,7 +694,8 @@ impl<'gc> ChildContainer<'gc> {
let removed_from_execution_list = if from_lists.contains(Lists::Execution) {
let present_on_execution_list = child.prev_sibling().is_none()
|| child.next_sibling().is_none()
|| (self.exec_list.is_some() && DisplayObject::ptr_eq(self.exec_list.unwrap(), child));
|| (self.exec_list.is_some()
&& DisplayObject::ptr_eq(self.exec_list.unwrap(), child));
self.remove_child_from_exec_list(context, child);
child.set_parent(context.gc_context, None);

View File

@ -1631,10 +1631,18 @@ impl<'gc> MovieClip<'gc> {
if let Some(child) = read.container.get_depth(depth) {
if !child.placed_by_script() {
drop(read);
self.0.write(context.gc_context).container.remove_child(context, child, EnumSet::all());
self.0.write(context.gc_context).container.remove_child(
context,
child,
EnumSet::all(),
);
} else {
drop(read);
self.0.write(context.gc_context).container.remove_child(context, child, Lists::Depth.into());
self.0.write(context.gc_context).container.remove_child(
context,
child,
Lists::Depth.into(),
);
}
}
}

View File

@ -1,16 +1,16 @@
pub use crate::bounding_box::BoundingBox;
pub use crate::color_transform::ColorTransform;
pub use crate::display_object::{
DisplayObject, DisplayObjectContainer, TDisplayObject, TDisplayObjectContainer, Lists
DisplayObject, DisplayObjectContainer, Lists, TDisplayObject, TDisplayObjectContainer,
};
pub use crate::{
impl_display_object, impl_display_object_container, impl_display_object_sansbounds,
};
pub use enumset::EnumSet;
pub use log::{error, info, trace, warn};
pub use std::ops::RangeBounds;
pub use swf::Matrix;
pub use swf::{CharacterId, Color, Twips};
pub use enumset::EnumSet;
/// A depth for a Flash display object in AVM1.
/// This is different than defined in `swf`; during execution, clips