Skip to content

Commit

Permalink
Fix property diffing to account for various node states
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Apr 7, 2021
1 parent 8f58d16 commit 5c4dc13
Show file tree
Hide file tree
Showing 5 changed files with 423 additions and 253 deletions.
6 changes: 6 additions & 0 deletions azul-core/src/dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,15 @@ impl_vec_eq!(CallbackData, CallbackDataVec);
impl_vec_hash!(CallbackData, CallbackDataVec);

impl CallbackDataVec {
#[inline]
pub fn as_container<'a>(&'a self) -> NodeDataContainerRef<'a, CallbackData> {
NodeDataContainerRef { internal: self.as_ref() }
}
#[inline]
pub fn as_container_mut<'a>(&'a mut self) -> NodeDataContainerRefMut<'a, CallbackData> {
NodeDataContainerRefMut { internal: self.as_mut() }
}
#[inline]
pub(crate) fn into_library_owned_vec(&mut self) -> Vec<CallbackData> {
let mut vec = Vec::with_capacity(self.as_ref().len());
for item in self.as_mut().iter_mut() {
Expand Down Expand Up @@ -686,12 +689,15 @@ impl_vec_eq!(NodeData, NodeDataVec);
impl_vec_hash!(NodeData, NodeDataVec);

impl NodeDataVec {
#[inline]
pub fn as_container<'a>(&'a self) -> NodeDataContainerRef<'a, NodeData> {
NodeDataContainerRef { internal: self.as_ref() }
}
#[inline]
pub fn as_container_mut<'a>(&'a mut self) -> NodeDataContainerRefMut<'a, NodeData> {
NodeDataContainerRefMut { internal: self.as_mut() }
}
#[inline]
pub fn into_library_owned_vec(&mut self) -> Vec<NodeData> {
let mut vec = Vec::with_capacity(self.as_ref().len());
for item in self.as_mut().iter_mut() {
Expand Down
Loading

0 comments on commit 5c4dc13

Please sign in to comment.