Add optional Serde implementations and missing derivable traits (#652)
* Add optional serde feature * Document features in README * Add changelog entry * Implement some missing derivable traits * Add changelog entry for std derives * Remove extraneous space on serde doc comments * Add period to end of serde line in readme * Remove serde impls from WindowAttributes * Add serde impls for TouchPhase * Add serde test file * Add feature lines to testing CIs * Remove WindowAttributes from changelog
This commit is contained in:
parent
214e157e5d
commit
6bec912961
9 changed files with 79 additions and 8 deletions
|
|
@ -92,6 +92,7 @@ pub fn validate_hidpi_factor(dpi_factor: f64) -> bool {
|
|||
/// 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)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct LogicalPosition {
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
|
|
@ -152,6 +153,7 @@ impl Into<(i32, i32)> for LogicalPosition {
|
|||
/// 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)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct PhysicalPosition {
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
|
|
@ -212,6 +214,7 @@ impl Into<(i32, i32)> for PhysicalPosition {
|
|||
/// which can cause noticable issues. To help with that, an `Into<(u32, u32)>` implementation is provided which
|
||||
/// does the rounding for you.
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct LogicalSize {
|
||||
pub width: f64,
|
||||
pub height: f64,
|
||||
|
|
@ -272,6 +275,7 @@ impl Into<(u32, u32)> for LogicalSize {
|
|||
/// which can cause noticable issues. To help with that, an `Into<(u32, u32)>` implementation is provided which
|
||||
/// does the rounding for you.
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct PhysicalSize {
|
||||
pub width: f64,
|
||||
pub height: f64,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue