Merge pull request #1140 from Imberflur/hash-container-align

Include alignment in the container layout hash
This commit is contained in:
Héctor Ramón 2021-12-07 12:03:11 +07:00 committed by GitHub
commit 3f5ec5b20a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -37,7 +37,7 @@ impl From<Vertical> for Alignment {
} }
/// The horizontal [`Alignment`] of some resource. /// The horizontal [`Alignment`] of some resource.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Horizontal { pub enum Horizontal {
/// Align left /// Align left
Left, Left,
@ -50,7 +50,7 @@ pub enum Horizontal {
} }
/// The vertical [`Alignment`] of some resource. /// The vertical [`Alignment`] of some resource.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Vertical { pub enum Vertical {
/// Align top /// Align top
Top, Top,

View file

@ -226,6 +226,8 @@ where
self.height.hash(state); self.height.hash(state);
self.max_width.hash(state); self.max_width.hash(state);
self.max_height.hash(state); self.max_height.hash(state);
self.horizontal_alignment.hash(state);
self.vertical_alignment.hash(state);
self.content.hash_layout(state); self.content.hash_layout(state);
} }