Skip to content

Commit

Permalink
fixed inspector syncing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Oct 29, 2024
1 parent 77e0a89 commit a790572
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fyrox-ui/src/inspector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,12 @@ impl PartialEq for InspectorContext {
}
}

fn object_type_id(object: &dyn Reflect) -> TypeId {
let mut object_type_id = None;
object.as_any(&mut |any| object_type_id = Some(any.type_id()));
object_type_id.unwrap()
}

impl Default for InspectorContext {
fn default() -> Self {
Self {
Expand Down Expand Up @@ -969,7 +975,7 @@ impl InspectorContext {
property_definitions: definition_container,
sync_flag,
environment,
object_type_id: object.type_id(),
object_type_id: object_type_id(object),
name_column_width,
}
}
Expand All @@ -993,7 +999,7 @@ impl InspectorContext {
generate_property_string_values: bool,
filter: PropertyFilter,
) -> Result<(), Vec<InspectorError>> {
if object.type_id() != self.object_type_id {
if object_type_id(object) != self.object_type_id {
return Err(vec![InspectorError::OutOfSync]);
}

Expand Down

0 comments on commit a790572

Please sign in to comment.