Skip to main content

Module geometry

Module geometry 

Source
Expand description

Portable 2-D geometry types used at the host ↔ runtime boundary.

All three aliases are thin wrappers over euclid::default::*<f32>. They appear on:

  • FrameHostInput.pointer_hover: Option<PortablePoint> — hover position relative to the host viewport.
  • FrameHostInput.viewport_size: PortableSize — current viewport extents.
  • FrameViewModel.active_pane_rects: Vec<(PaneId, NodeKey, PortableRect)> — pane layout rects.
  • DegradedReceiptSpec.tile_rect: PortableRect — degraded-mode overlay placement.

Egui hosts convert between these and egui::{Pos2, Vec2, Rect} at the widget boundary via helpers in the shell crate’s compositor_adapter module; iced hosts consume them directly. The type aliases themselves are fully portable — euclid has no platform or framework dependencies.

Pre-M4 slice 8 (2026-04-22) these aliases lived in shell/desktop/workbench/compositor_adapter.rs alongside the egui conversion helpers. Promoting them here makes the view-model types they appear in portable without importing the shell-crate compositor module.

Type Aliases§

PortablePoint
Portable 2-D point, f32-valued. Typically represents a pointer position or a layout anchor in host-viewport coordinates.
PortableRect
Portable rectangle type. origin is the top-left corner; size is the rect extent. Uses f32 throughout.
PortableSize
Portable 2-D size (width × height), f32-valued. Typically represents a viewport or pane extent in host-viewport coordinates.
PortableVector
Portable 2-D vector, f32-valued. Typically represents a layout or physics delta in graph/canvas coordinates.