Fix #4382: the Eyedropper's Alt-click puts what it picked up on the object clicked when nothing is selected

With nothing selected, a click with the Eyedropper picks up an object's attributes and an Alt/Option-click on another object applies them, as the reference app's Eyedropper does. Alt-click only copied from a selected object, and with nothing selected it failed. The session now keeps a copy of what appearance.copyFrom picked up last, and a reversed copy with nothing selected applies it.
This commit is contained in:
bflatastic
2026-10-29 19:57:59 +07:00
parent d3d1e31219
commit bbbc711b6a
4 changed files with 42 additions and 8 deletions
+3
View File
@@ -90,6 +90,9 @@ pub struct Session {
/// The Appearance panel's active fill/stroke row (`appearance.setActiveItem`); not saved. Read
/// it through [`Session::appearance_item`], which drops it once the selection changes.
pub(crate) active_appearance_item: Option<cmd::appearance::ActiveItem>,
/// What the Eyedropper picked up last (`appearance.copyFrom`): an Alt-click with nothing
/// selected puts it on the object clicked (#4382). Not saved.
pub(crate) eyedropper_sample: Option<Arc<vectorcraft_doc::Node>>,
/// The last solid colour applied (the toolbar's Color button; `,` applies it again).
pub last_solid: Color,
/// The last gradient applied (the toolbar's Gradient button; `.` applies it again).