Save unverified allocation and repair work at user-requested pause
This commit is contained in:
@@ -416,6 +416,12 @@ impl Rect {
|
||||
&& other.position.x + other.size.width <= self.position.x + self.size.width
|
||||
&& other.position.y + other.size.height <= self.position.y + self.size.height
|
||||
}
|
||||
fn overlaps(self, other: Self) -> bool {
|
||||
self.position.x < other.position.x + other.size.width
|
||||
&& other.position.x < self.position.x + self.size.width
|
||||
&& self.position.y < other.position.y + other.size.height
|
||||
&& other.position.y < self.position.y + self.size.height
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
@@ -583,6 +589,18 @@ pub fn place(
|
||||
"Make room or adjust the view, then drag again.".into(),
|
||||
));
|
||||
}
|
||||
// A performer may legitimately enclose the work, but its frozen feedback
|
||||
// label is painted above the candidate. Check their joint readability after
|
||||
// projection, including same-performer moves; never shift either rectangle.
|
||||
if presentation
|
||||
.target
|
||||
.is_some_and(|target| header.overlaps(target.label))
|
||||
{
|
||||
return Err(Refusal::LayoutRequired(
|
||||
"The work header overlaps the performer label. Aim below or beside the label, then drag again."
|
||||
.into(),
|
||||
));
|
||||
}
|
||||
Ok(PlacementPlan {
|
||||
diagram,
|
||||
view,
|
||||
|
||||
Reference in New Issue
Block a user