Skip to main content

FullElementScrollState

Trait FullElementScrollState 

Source
pub trait FullElementScrollState: FullElementCursorState {
    // Required methods
    fn get_mouse_pos(&self) -> Vector2;
    fn get_mouse_wheel_move_v(&self) -> Vector2;
    fn get_bound_box(&self, id: ElementId) -> Option<BoundingBox>;
    fn internal_size(&self, id: ElementId) -> Option<Vector2>;
}
Expand description

Combines cursor state, wheel input, and layout bounds for element scrolling.

Implementors supply mouse position, wheel delta, bounding box, and internal clip size for scroll clamping.

§Blanket implementation

CotisApp implements this trait when:

  • Renderer: RenderCompatibleWith<Manager> + MouseProvider
  • Manager: LayoutManagerCompatible<Renderer> + ElementBoundingBox + ElementClipInternalSize

Required Methods§

Source

fn get_mouse_pos(&self) -> Vector2

Current cursor position in pixels.

Source

fn get_mouse_wheel_move_v(&self) -> Vector2

Wheel delta; x is horizontal, y is vertical per MouseProvider.

Source

fn get_bound_box(&self, id: ElementId) -> Option<BoundingBox>

Layout bounding box for the element.

Source

fn internal_size(&self, id: ElementId) -> Option<Vector2>

Internal clipped content size for scroll limit calculation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Renderer: RenderCompatibleWith<Manager> + MouseProvider, Manager: LayoutManagerCompatible<Renderer> + ElementBoundingBox + ElementClipInternalSize, Pipe> FullElementScrollState for CotisApp<Renderer, Manager, Pipe>

Implementors§