// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT pub use dpi::*; use serde::Serialize; /// A rectangular region. #[derive(Clone, Copy, Debug, Serialize)] pub struct Rect { /// Rect position. pub position: dpi::Position, /// Rect size. pub size: dpi::Size, } impl Default for Rect { fn default() -> Self { Self { position: Position::Logical((0, 0).into()), size: Size::Logical((0, 0).into()), } } } /// A rectangular region in physical pixels. #[derive(Clone, Copy, Debug, Serialize)] pub struct PhysicalRect { /// Rect position. pub position: dpi::PhysicalPosition

, /// Rect size. pub size: dpi::PhysicalSize, } impl Default for PhysicalRect { fn default() -> Self { Self { position: (0, 0).into(), size: (0, 0).into(), } } } /// A rectangular region in logical pixels. #[derive(Clone, Copy, Debug, Serialize)] pub struct LogicalRect { /// Rect position. pub position: dpi::LogicalPosition

, /// Rect size. pub size: dpi::LogicalSize, } impl Default for LogicalRect { fn default() -> Self { Self { position: (0, 0).into(), size: (0, 0).into(), } } }