RelocatableState

Trait RelocatableState 

Source
pub trait RelocatableState {
    // Required method
    fn relocate(&mut self, shift: (i16, i16), clip: Rect);
}
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.

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§