Skip to main content

ferroui_base/layout/
effective_viewport_changed_event_args.rs

1use crate::Rect;
2
3/// Provides data for the effective viewport changed event of a layoutable.
4#[derive(Clone, Copy, Debug, PartialEq)]
5pub struct EffectiveViewportChangedEventArgs {
6    effective_viewport: Rect,
7}
8
9impl EffectiveViewportChangedEventArgs {
10    pub fn new(effective_viewport: Rect) -> Self {
11        Self { effective_viewport }
12    }
13
14    /// The rect representing the effective viewport.
15    ///
16    /// The effective viewport is expressed in the coordinate system of the
17    /// control that the event is raised on.
18    pub fn effective_viewport(&self) -> Rect {
19        self.effective_viewport
20    }
21}