mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-27 03:56:33 +11:00
Derive Default
, Hash
, and Eq
for some dpi types (#1833)
* Derive more things * Changelog entry
This commit is contained in:
parent
dabcb1834d
commit
04b4e48265
2 changed files with 5 additions and 4 deletions
|
@ -23,6 +23,7 @@
|
||||||
- On Windows, added `WindowBuilderExtWindows::with_owner_window` to allow creating popup windows.
|
- 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 Windows, added `WindowExtWindows::set_enable` to allow creating modal popup windows.
|
||||||
- On macOS, emit `RedrawRequested` events immediately while the window is being resized.
|
- 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)
|
# 0.24.0 (2020-12-09)
|
||||||
|
|
||||||
|
|
|
@ -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
|
/// 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)>`
|
/// fractional part, which can cause noticable issues. To help with that, an `Into<(i32, i32)>`
|
||||||
/// implementation is provided which does the rounding for you.
|
/// 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))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub struct LogicalPosition<P> {
|
pub struct LogicalPosition<P> {
|
||||||
pub x: P,
|
pub x: P,
|
||||||
|
@ -228,7 +228,7 @@ impl<P: Pixel, X: Pixel> Into<[X; 2]> for LogicalPosition<P> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A position represented in physical pixels.
|
/// 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))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub struct PhysicalPosition<P> {
|
pub struct PhysicalPosition<P> {
|
||||||
pub x: P,
|
pub x: P,
|
||||||
|
@ -293,7 +293,7 @@ impl<P: Pixel, X: Pixel> Into<[X; 2]> for PhysicalPosition<P> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A size represented in logical pixels.
|
/// 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))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub struct LogicalSize<P> {
|
pub struct LogicalSize<P> {
|
||||||
pub width: P,
|
pub width: P,
|
||||||
|
@ -358,7 +358,7 @@ impl<P: Pixel, X: Pixel> Into<[X; 2]> for LogicalSize<P> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A size represented in physical pixels.
|
/// 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))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub struct PhysicalSize<P> {
|
pub struct PhysicalSize<P> {
|
||||||
pub width: P,
|
pub width: P,
|
||||||
|
|
Loading…
Add table
Reference in a new issue