1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright 2026 Mark Alan Boykin
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: MPL-2.0
//! 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.
/// Portable rectangle type. `origin` is the top-left corner; `size` is
/// the rect extent. Uses `f32` throughout.
pub type PortableRect = Rect;
/// Portable 2-D point, `f32`-valued. Typically represents a pointer
/// position or a layout anchor in host-viewport coordinates.
pub type PortablePoint = Point2D;
/// Portable 2-D size (width × height), `f32`-valued. Typically
/// represents a viewport or pane extent in host-viewport coordinates.
pub type PortableSize = Size2D;
/// Portable 2-D vector, `f32`-valued. Typically represents a layout or
/// physics delta in graph/canvas coordinates.
pub type PortableVector = Vector2D;