M12: stamps stick to the objects they land on, which are highlighted first (#1671)

* M12: stamps stick to the objects they land on

A stamp sticks to the topmost object under its centre (BoardItem::Stamp gains an optional on, left out when empty so older files open with stamps on nothing) and the board's normalize pass carries it when that object moves or turns, once when both move together. A stamp dragged onto another object sticks to that one, off everything to nothing; one whose object is deleted stays where it is. Gap 24.

* M12: the object a stamp will stick to is highlighted

While the stamp tool is over an object, or a stamp is dragged over one, the object it will stick to is outlined with the canvas's hover outline (Overlay::stamp_target, found by the same stamp_target as board.stamp and settle_stamps). A drag no longer drops what it moves into the auto layout of a sticky, shape with text or table: board objects take no drops; a stamp already inside its sticky moves with it once. Builds on #1671. Gap 24.
This commit is contained in:
BFlat
2026-10-31 00:25:38 +07:00
committed by GitHub
parent 87f3edbc7e
commit e97961ba66
18 changed files with 205 additions and 8 deletions
+3 -1
View File
@@ -49,11 +49,13 @@ pub enum BoardItem {
Connector(Connector),
/// The label in the middle of connector `connector` (a frame holding its text).
Label { connector: NodeId },
/// A stamp, and who placed it.
/// A stamp, who placed it, and the object it sits on (it moves with it).
Stamp {
stamp: Stamp,
#[serde(default, skip_serializing_if = "String::is_empty")]
author: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
on: Option<NodeId>,
},
/// A marker or highlighter stroke (what the eraser takes).
Ink,