From f31896d5df462308231f994082d1c0b445a153d2 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Thu, 23 Oct 2025 12:31:52 +0200 Subject: [PATCH] Fix incorrect implementations of the Hash and PartialEq traits on Table --- node-graph/gcore/src/table.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/node-graph/gcore/src/table.rs b/node-graph/gcore/src/table.rs index 761d708748..277fe557b5 100644 --- a/node-graph/gcore/src/table.rs +++ b/node-graph/gcore/src/table.rs @@ -2,7 +2,7 @@ use crate::bounds::{BoundingBox, RenderBoundingBox}; use crate::transform::ApplyTransform; use crate::uuid::NodeId; use crate::{AlphaBlending, math::quad::Quad}; -use dyn_any::StaticType; +use dyn_any::{StaticType, StaticTypeSized}; use glam::DAffine2; use std::hash::Hash; @@ -203,6 +203,18 @@ impl Hash for Table { for element in &self.element { element.hash(state); } + for transform in &self.transform { + transform.to_cols_array().map(|x| x.to_bits()).hash(state); + } + for alpha_blending in &self.alpha_blending { + alpha_blending.hash(state); + } + } +} + +impl PartialEq for Table { + fn eq(&self, other: &Self) -> bool { + self.element == other.element && self.transform == other.transform && self.alpha_blending == other.alpha_blending } } @@ -220,14 +232,8 @@ impl ApplyTransform for Table { } } -impl PartialEq for Table { - fn eq(&self, other: &Self) -> bool { - self.element.len() == other.element.len() && { self.element.iter().zip(other.element.iter()).all(|(a, b)| a == b) } - } -} - -unsafe impl StaticType for Table { - type Static = Table; +unsafe impl StaticType for Table { + type Static = Table; } impl FromIterator> for Table {