RelocatableState

Trait RelocatableState 

Source
pub trait RelocatableState {
    // Required method
    fn relocate(&mut self, shift: (i16, i16), clip: Rect);

    // Provided methods
    fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect) { ... }
    fn relocate_popup_hidden(&mut self) { ... }
    fn relocate_hidden(&mut self) { ... }
}
Expand description

Widgets can be rendered to a temporary Buffer that will be dumped to the main render Buffer at a later point.

This temporary Buffer can have its own coordinate system and output in the main render Buffer can happen anywhere.

Most rat-widgets store one or more areas during rendering for later mouse interactions. All these areas need to be adjusted whenever such a temporary Buffer is used.

This trait provides the entry point for such an adjustment.

Required Methods§

Source

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Relocate the areas in this widgets state.

  • shift: positions are moved by (x,y)
  • clip: areas must be clipped to the given Rect.

Provided Methods§

Source

fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)

Relocate only popup areas. As rendering the popups is a separate render, this has to be separate too.

Source

fn relocate_popup_hidden(&mut self)

Relocate all popup areas to a clip-rect (0,0+0x0).

Source

fn relocate_hidden(&mut self)

Relocate all areas to a clip-rect (0,0+0x0).

Implementations on Foreign Types§

Source§

impl RelocatableState for ()

Source§

fn relocate(&mut self, _shift: (i16, i16), _clip: Rect)

Source§

impl RelocatableState for Rect

Source§

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Source§

impl RelocatableState for [Rect]

Source§

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Implementors§