Call the record's boxes what they are

The offer names are from the protocol before this one, where a widget was
drawn twice and the record had to say which drawing was the question. It
is asked once now, so offer_part is the part it was asked in, offer_place
the place it was asked at, and place where its drawing was put: part,
asked and placed. LayoutHolds::frame is a range on the window since the
frame became a length of one, and the frame's own entry is the frame_len
pin beside it, so it is window; Painter::frame_own goes with it.
answers_at had one caller and said less than the line that replaces it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-19 00:40:23 -04:00
1 parent adbedaf264
commit a30971e4c5
6 files changed
+67 -71

No files matched your search

+6 -6
View File
@@ -20,7 +20,7 @@ const AXES: [Axis; 2] = [Axis::X, Axis::Y];
/// whatever the frame turns out to be.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct LayoutHolds {
pub frame: [Holds; 2],
pub window: [Holds; 2],
pub frame_len: [Option<Len>; 2],
pub extent: [Holds; 2],
pub extent_len: [Option<Len>; 2],
@@ -28,7 +28,7 @@ pub struct LayoutHolds {
impl LayoutHolds {
pub const ANY: Self = Self {
frame: [Holds::ANY; 2],
window: [Holds::ANY; 2],
frame_len: [None; 2],
extent: [Holds::ANY; 2],
extent_len: [None; 2],
@@ -37,7 +37,7 @@ impl LayoutHolds {
pub fn and(self, other: Self) -> Self {
let mut result = Self::ANY;
for n in 0..2 {
result.frame[n] = self.frame[n].and(other.frame[n]);
result.window[n] = self.window[n].and(other.window[n]);
result.extent[n] = self.extent[n].and(other.extent[n]);
debug_assert!(
self.extent_len[n].is_none()
@@ -57,8 +57,8 @@ impl LayoutHolds {
pub fn covers(self, other: Self) -> bool {
(0..2).all(|n| {
self.frame[n].lo <= other.frame[n].lo
&& self.frame[n].hi >= other.frame[n].hi
self.window[n].lo <= other.window[n].lo
&& self.window[n].hi >= other.window[n].hi
&& self.extent[n].lo <= other.extent[n].lo
&& self.extent[n].hi >= other.extent[n].hi
&& self.extent_len[n].is_none_or(|len| other.extent_len[n] == Some(len))
@@ -70,7 +70,7 @@ impl LayoutHolds {
AXES.into_iter().all(|axis| {
let n = axis as usize;
let len = extent.axis(axis).len();
self.frame[n].contains(window.axis(axis))
self.window[n].contains(window.axis(axis))
&& self.frame_len[n].is_none_or(|pinned| pinned == frame.axis(axis))
&& self.extent[n].contains(len.to_px(window.axis(axis)))
&& self.extent_len[n].is_none_or(|pinned| pinned == len)