diff --git a/CHANGELOG.md b/CHANGELOG.md index d88de9d9..a14bc047 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - On Windows, added `WindowBuilderExtWindows::with_owner_window` to allow creating popup windows. - On Windows, added `WindowExtWindows::set_enable` to allow creating modal popup windows. - On macOS, emit `RedrawRequested` events immediately while the window is being resized. +- Implement `Default`, `Hash`, and `Eq` for `LogicalPosition`, `PhysicalPosition`, `LogicalSize`, and `PhysicalSize`. # 0.24.0 (2020-12-09) diff --git a/src/dpi.rs b/src/dpi.rs index ed30abb7..ff0b0c95 100644 --- a/src/dpi.rs +++ b/src/dpi.rs @@ -163,7 +163,7 @@ pub fn validate_scale_factor(scale_factor: f64) -> bool { /// The position is stored as floats, so please be careful. Casting floats to integers truncates the /// fractional part, which can cause noticable issues. To help with that, an `Into<(i32, i32)>` /// implementation is provided which does the rounding for you. -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct LogicalPosition
{
pub x: P,
@@ -228,7 +228,7 @@ impl {
}
/// A position represented in physical pixels.
-#[derive(Debug, Copy, Clone, PartialEq)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PhysicalPosition {
pub x: P,
@@ -293,7 +293,7 @@ impl {
}
/// A size represented in logical pixels.
-#[derive(Debug, Copy, Clone, PartialEq)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LogicalSize {
pub width: P,
@@ -358,7 +358,7 @@ impl {
}
/// A size represented in physical pixels.
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PhysicalSize {
pub width: P,