pub fn anchor_of(rect: Rect, bounds: Rect) -> AnchorExpand description
The workbench edges a palette’s rect lies on, within half a point:
its anchor. A side off the edges (dragged away, or snapped to another
palette) is not anchored; on both edges of an axis (as large as the
workbench), the start wins.
use egui::{Rect, pos2, vec2};
use egui_pop_api::palettes::anchor_of;
use egui_pop_model::layout::AnchorEdge;
let bounds = Rect::from_min_size(pos2(0.0, 0.0), vec2(800.0, 600.0));
let r = Rect::from_min_size(pos2(700.0, 200.0), vec2(100.0, 50.0));
let a = anchor_of(r, bounds);
assert_eq!((a.x, a.y), (AnchorEdge::End, AnchorEdge::None));