pub struct ScrollBase {
pub offset: Vector2D<usize>,
pub viewport: Vector2D<usize>,
pub render_size: TPoint,
pub scroll_viewer: Weak<RefCell<ScrollViewer>>,
}Expand description
Base struct for storing different information required for the Scrollable trait Has all fns of Scrollable but doesn’t implement the trait
Fields§
§offset: Vector2D<usize>Offset of the base 0,0 coordinate (as in rendering)
viewport: Vector2D<usize>Viewport for the whole content to be rendered
render_size: TPointActual size rendered
scroll_viewer: Weak<RefCell<ScrollViewer>>Weak reference to the owning scroll viewer
Implementations§
Source§impl ScrollBase
impl ScrollBase
pub fn is_scrollable(&self, axis: Orientation) -> bool
pub fn scroll(&mut self, direction: Direction, kind: ScrollKind)
pub fn set_offset(&mut self, direction: Orientation, offset: usize)
pub fn offset(&self, axis: Orientation) -> usize
pub fn viewport(&self, axis: Orientation) -> usize
pub fn set_scroll_viewer(&mut self, scroll_viewer: Weak<RefCell<ScrollViewer>>)
Trait Implementations§
Source§impl Clone for ScrollBase
impl Clone for ScrollBase
Source§fn clone(&self) -> ScrollBase
fn clone(&self) -> ScrollBase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScrollBase
impl Debug for ScrollBase
Source§impl Default for ScrollBase
impl Default for ScrollBase
Source§fn default() -> ScrollBase
fn default() -> ScrollBase
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ScrollBase
impl !Send for ScrollBase
impl !Sync for ScrollBase
impl !UnwindSafe for ScrollBase
impl Freeze for ScrollBase
impl Unpin for ScrollBase
impl UnsafeUnpin for ScrollBase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more