rat-reloc

Crates.iorat-reloc
lib.rsrat-reloc
version2.0.2
created_at2024-11-01 19:51:37.236351+00
updated_at2026-01-06 08:19:51.72308+00
descriptionrelocate widgets after rendering
homepage
repositoryhttps://github.com/thscharler/rat-salsa
max_upload_size
id1432242
size16,881
(thscharler)

documentation

README

semver stable crates.io Documentation License License

This crate is a part of rat-salsa.

Rat-Reloc(ate)

This crate defines the trait RelocatableState

Why?

Many widgets in rat-widget store one or more areas for mouse interaction.

And there are widgets that render other widgets to a temp Buffer and later dump parts of it to the main render Buffer. And then all the stored areas in the widget-state are wrong.

The RelocatableState trait gives the widgets that use such temp Buffers a hook to correct for any movement and clipping that has happened.

Why so complicated?

  • This doesn't affect normal rendering of a widget, it's just and afterthought.
  • The widget doesn't need to know what other widgets exist, it just has to provide the function to relocate its areas after rendering.
Commit count: 3278

cargo fmt