Add persistent grid and pivot toolbar tools
This commit is contained in:
parent
a9b82c89ff
commit
7cdf3a054f
|
|
@ -46,6 +46,8 @@ pub struct Editor {
|
|||
layer_order: Vec<usize>,
|
||||
keep_aspect_ratio: bool,
|
||||
resize_mode: ResizeMode,
|
||||
grid_tool: Option<u32>,
|
||||
pivot_tool: bool,
|
||||
pivot_relative: [f64; 2],
|
||||
pivot_selection: Vec<usize>,
|
||||
pivot_drag: Option<(usize, [f64; 2])>,
|
||||
|
|
@ -249,6 +251,8 @@ impl Default for Editor {
|
|||
layer_order: Vec::new(),
|
||||
keep_aspect_ratio: true,
|
||||
resize_mode: ResizeMode::Individual,
|
||||
grid_tool: None,
|
||||
pivot_tool: false,
|
||||
pivot_relative: [0.5; 2],
|
||||
pivot_selection: Vec::new(),
|
||||
pivot_drag: None,
|
||||
|
|
@ -1739,6 +1743,24 @@ impl Editor {
|
|||
}
|
||||
None
|
||||
}
|
||||
fn effective_grid(&self, modifiers: egui::Modifiers) -> Option<u32> {
|
||||
if modifiers.alt {
|
||||
return None;
|
||||
}
|
||||
if modifiers.shift {
|
||||
let requested = if modifiers.ctrl { 100 } else { 10 };
|
||||
if self.grid_tool == Some(requested) {
|
||||
None
|
||||
} else {
|
||||
Some(requested)
|
||||
}
|
||||
} else {
|
||||
self.grid_tool
|
||||
}
|
||||
}
|
||||
fn effective_pivot(&self, modifiers: egui::Modifiers) -> bool {
|
||||
self.pivot_tool ^ (modifiers.ctrl && !modifiers.shift)
|
||||
}
|
||||
fn drag_with_modifiers(
|
||||
&mut self,
|
||||
point: [f64; 2],
|
||||
|
|
@ -1746,10 +1768,9 @@ impl Editor {
|
|||
scale: f32,
|
||||
) -> [Option<f64>; 2] {
|
||||
self.layout
|
||||
.use_resize_pivot(modifiers.ctrl && !modifiers.shift);
|
||||
if modifiers.shift && !modifiers.alt {
|
||||
self.layout
|
||||
.drag_to_grid(point, if modifiers.ctrl { 100.0 } else { 10.0 })
|
||||
.use_resize_pivot(self.effective_pivot(modifiers));
|
||||
if let Some(spacing) = self.effective_grid(modifiers) {
|
||||
self.layout.drag_to_grid(point, spacing as f64)
|
||||
} else {
|
||||
let mut snapping = self.snapping;
|
||||
if modifiers.alt {
|
||||
|
|
@ -1785,7 +1806,7 @@ impl Editor {
|
|||
}
|
||||
// Keep captions separate from the buttons, with room for their full names.
|
||||
let names = self.show_toolbar_icon_names;
|
||||
let extra_height = if names { 22.0 } else { 0.0 };
|
||||
let mut extra_height = if names { 22.0 } else { 0.0 };
|
||||
let (strip_x, strip_width, separator, positions, align_x, import_x, project_x, options_x) =
|
||||
if names {
|
||||
(
|
||||
|
|
@ -1810,6 +1831,69 @@ impl Editor {
|
|||
390.0,
|
||||
)
|
||||
};
|
||||
let tools_wrapped = r.width() < options_x + 52.0 + 132.0 + 16.0;
|
||||
let tools_x = if tools_wrapped {
|
||||
24.0
|
||||
} else {
|
||||
options_x + 52.0
|
||||
};
|
||||
let tools_y = if tools_wrapped {
|
||||
62.0 + extra_height
|
||||
} else {
|
||||
22.0
|
||||
};
|
||||
if tools_wrapped {
|
||||
extra_height += if names { 56.0 } else { 40.0 };
|
||||
}
|
||||
let modifiers = ui.input(|i| i.modifiers);
|
||||
for (slot, grid, label, tooltip) in [
|
||||
(
|
||||
0,
|
||||
Some(10),
|
||||
"10 px",
|
||||
"10 px grid — click to toggle. Hold Shift for the same effect; if selected, Shift temporarily disables it. Ctrl+Shift switches to 100 px. Alt overrides grids.",
|
||||
),
|
||||
(
|
||||
1,
|
||||
Some(100),
|
||||
"100 px",
|
||||
"100 px grid — click to toggle. Hold Ctrl+Shift for the same effect; if selected, Ctrl+Shift temporarily disables it. Shift switches to 10 px. Alt overrides grids.",
|
||||
),
|
||||
(
|
||||
2,
|
||||
None,
|
||||
"Pivot",
|
||||
"Pivot resize — click to toggle. Hold Ctrl for the same effect; if selected, Ctrl temporarily disables it. Combines with either grid. Drag the pivot; double-click it to center. Applies to layer handles.",
|
||||
),
|
||||
] {
|
||||
let rect = Rect::from_min_size(
|
||||
ink.point(tools_x + slot as f32 * 44.0, tools_y),
|
||||
Vec2::splat(32.0),
|
||||
);
|
||||
let selected = grid.map_or(self.pivot_tool, |n| self.grid_tool == Some(n));
|
||||
let effective = grid.map_or(self.effective_pivot(modifiers), |n| {
|
||||
self.effective_grid(modifiers) == Some(n)
|
||||
});
|
||||
if edit_tool_icon(ui, rect, grid, label, selected, effective)
|
||||
.on_hover_text(tooltip)
|
||||
.clicked()
|
||||
{
|
||||
if let Some(n) = grid {
|
||||
self.grid_tool = if selected { None } else { Some(n) };
|
||||
} else {
|
||||
self.pivot_tool = !self.pivot_tool;
|
||||
}
|
||||
}
|
||||
if names {
|
||||
ui.painter().text(
|
||||
rect.center_bottom() + Vec2::new(0.0, 7.0),
|
||||
Align2::CENTER_TOP,
|
||||
label,
|
||||
FontId::proportional(11.0),
|
||||
palette.muted,
|
||||
);
|
||||
}
|
||||
}
|
||||
ink.card(
|
||||
strip_x,
|
||||
20.0,
|
||||
|
|
@ -2095,8 +2179,7 @@ impl Editor {
|
|||
ResizeHandle::Top | ResizeHandle::Bottom => egui::CursorIcon::ResizeVertical,
|
||||
});
|
||||
}
|
||||
let pivot_visible =
|
||||
ui.input(|i| i.modifiers.ctrl && !i.modifiers.shift) && !self.edit_content;
|
||||
let pivot_visible = self.effective_pivot(ui.input(|i| i.modifiers)) && !self.edit_content;
|
||||
let pivot_hover = if pivot_visible {
|
||||
pointer.and_then(|p| self.pivot_hit(p, origin, scale))
|
||||
} else {
|
||||
|
|
@ -2546,7 +2629,7 @@ impl Editor {
|
|||
ink.text(
|
||||
24.0,
|
||||
r.height() - 40.0,
|
||||
if pivot_visible { "Ctrl: drag pivot · Resize around pivot · Double-click pivot to center · Ctrl+Shift: 100 px grid" } else if self.edit_content { "Crop mode · Drag crop handles to zoom content · Drag image to reposition · Click outside to finish" } else { match self.active_resize_mode() {
|
||||
if pivot_visible { "Pivot resize · Drag pivot to position · Double-click to center · Ctrl temporarily toggles pivot" } else if self.edit_content { "Crop mode · Drag crop handles to zoom content · Drag image to reposition · Click outside to finish" } else { match self.active_resize_mode() {
|
||||
ResizeMode::Individual => "Corners resize · Side handles keep opposite edge fixed · Shift-click selects",
|
||||
ResizeMode::Same => "Same handles · Matching handles scale selected layers proportionally · Escape cancels drag",
|
||||
ResizeMode::Mirror => "Mirror horizontally · Left/right mirrored handles · Escape cancels drag",
|
||||
|
|
@ -3077,6 +3160,72 @@ fn layer_state_icon(
|
|||
response.on_hover_text(label)
|
||||
}
|
||||
|
||||
fn edit_tool_icon(
|
||||
ui: &mut egui::Ui,
|
||||
rect: Rect,
|
||||
grid: Option<u32>,
|
||||
label: &str,
|
||||
selected: bool,
|
||||
effective: bool,
|
||||
) -> egui::Response {
|
||||
let palette = theme::palette(ui.ctx());
|
||||
let response = ui.interact(
|
||||
rect,
|
||||
egui::Id::new(("edit-tool", label)),
|
||||
egui::Sense::click(),
|
||||
);
|
||||
response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, true, label));
|
||||
let p = ui.painter();
|
||||
p.rect(
|
||||
rect,
|
||||
4.0,
|
||||
if effective {
|
||||
palette.purple
|
||||
} else {
|
||||
palette.field
|
||||
},
|
||||
Stroke::new(1.0_f32, if selected { palette.cyan } else { palette.line }),
|
||||
StrokeKind::Inside,
|
||||
);
|
||||
let c = rect.center();
|
||||
let stroke = Stroke::new(
|
||||
1.3_f32,
|
||||
if effective || response.hovered() {
|
||||
palette.cyan
|
||||
} else {
|
||||
palette.text
|
||||
},
|
||||
);
|
||||
if let Some(spacing) = grid {
|
||||
for offset in [-7.0, 0.0, 7.0] {
|
||||
p.line_segment(
|
||||
[c + Vec2::new(offset, -12.0), c + Vec2::new(offset, 2.0)],
|
||||
stroke,
|
||||
);
|
||||
p.line_segment(
|
||||
[
|
||||
c + Vec2::new(-7.0, offset - 5.0),
|
||||
c + Vec2::new(7.0, offset - 5.0),
|
||||
],
|
||||
stroke,
|
||||
);
|
||||
}
|
||||
p.text(
|
||||
c + Vec2::new(0.0, 3.0),
|
||||
Align2::CENTER_TOP,
|
||||
spacing.to_string(),
|
||||
FontId::proportional(10.0),
|
||||
stroke.color,
|
||||
);
|
||||
} else {
|
||||
p.circle_stroke(c, 7.0, stroke);
|
||||
p.line_segment([c - Vec2::new(11.0, 0.0), c + Vec2::new(11.0, 0.0)], stroke);
|
||||
p.line_segment([c - Vec2::new(0.0, 11.0), c + Vec2::new(0.0, 11.0)], stroke);
|
||||
p.circle_filled(c, 2.0, stroke.color);
|
||||
}
|
||||
response.on_hover_cursor(egui::CursorIcon::PointingHand)
|
||||
}
|
||||
|
||||
fn toolbar_icon(ui: &mut egui::Ui, rect: Rect, label: &str, icon: ToolbarIcon) -> egui::Response {
|
||||
let palette = theme::palette(ui.ctx());
|
||||
let response = ui.interact(rect, ui.id().with(("toolbar", label)), egui::Sense::click());
|
||||
|
|
@ -3225,6 +3374,160 @@ mod tests {
|
|||
);
|
||||
frame(app, ctx, vec![mouse(pos, false)]);
|
||||
}
|
||||
#[test]
|
||||
fn tool_icons_fit_above_the_canvas_with_captions_and_at_minimum_window_size() {
|
||||
for size in [Vec2::new(1000.0, 720.0), Vec2::new(1440.0, 940.0)] {
|
||||
for captions in [false, true] {
|
||||
let ctx = egui::Context::default();
|
||||
let mut app = Editor {
|
||||
show_toolbar_icon_names: captions,
|
||||
..Default::default()
|
||||
};
|
||||
for _ in 0..2 {
|
||||
let _ = ctx.run(
|
||||
egui::RawInput {
|
||||
screen_rect: Some(Rect::from_min_size(Pos2::ZERO, size)),
|
||||
..Default::default()
|
||||
},
|
||||
|ctx| app.ui(ctx),
|
||||
);
|
||||
}
|
||||
let canvas = ctx.read_response(egui::Id::new("canvas")).unwrap().rect;
|
||||
let mut previous: Option<Rect> = None;
|
||||
for label in ["10 px", "100 px", "Pivot"] {
|
||||
let rect = ctx
|
||||
.read_response(egui::Id::new(("edit-tool", label)))
|
||||
.unwrap()
|
||||
.rect;
|
||||
assert!(rect.right() <= canvas.right());
|
||||
assert!(rect.bottom() + if captions { 18.0 } else { 0.0 } < canvas.top());
|
||||
if let Some(before) = previous {
|
||||
assert!(rect.left() > before.right());
|
||||
}
|
||||
previous = Some(rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn persistent_tools_and_modifiers_combine_without_changing_latched_state() {
|
||||
for grid in [None, Some(10), Some(100)] {
|
||||
for pivot in [false, true] {
|
||||
let app = Editor {
|
||||
grid_tool: grid,
|
||||
pivot_tool: pivot,
|
||||
..Default::default()
|
||||
};
|
||||
for shift in [false, true] {
|
||||
for ctrl in [false, true] {
|
||||
for alt in [false, true] {
|
||||
let modifiers = egui::Modifiers {
|
||||
shift,
|
||||
ctrl,
|
||||
alt,
|
||||
..Default::default()
|
||||
};
|
||||
let requested = if ctrl { 100 } else { 10 };
|
||||
let expected_grid = if alt || (shift && grid == Some(requested)) {
|
||||
None
|
||||
} else if shift {
|
||||
Some(requested)
|
||||
} else {
|
||||
grid
|
||||
};
|
||||
assert_eq!(app.effective_grid(modifiers), expected_grid);
|
||||
assert_eq!(
|
||||
app.effective_pivot(modifiers),
|
||||
if ctrl && !shift { !pivot } else { pivot }
|
||||
);
|
||||
assert_eq!(app.grid_tool, grid);
|
||||
assert_eq!(app.pivot_tool, pivot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn grid_and_pivot_icons_toggle_independently_and_do_not_edit_layers() {
|
||||
let ctx = egui::Context::default();
|
||||
let mut app = Editor::default();
|
||||
let before = app.layout.layers().clone();
|
||||
let formats = app.layout.formats().clone();
|
||||
for (label, grid, pivot) in [
|
||||
("10 px", Some(10), false),
|
||||
("Pivot", Some(10), true),
|
||||
("100 px", Some(100), true),
|
||||
("100 px", None, true),
|
||||
("Pivot", None, false),
|
||||
] {
|
||||
frame(&mut app, &ctx, vec![]);
|
||||
let pos = ctx
|
||||
.read_response(egui::Id::new(("edit-tool", label)))
|
||||
.unwrap()
|
||||
.rect
|
||||
.center();
|
||||
frame(
|
||||
&mut app,
|
||||
&ctx,
|
||||
vec![egui::Event::PointerMoved(pos), mouse(pos, true)],
|
||||
);
|
||||
frame(&mut app, &ctx, vec![mouse(pos, false)]);
|
||||
assert_eq!(app.grid_tool, grid);
|
||||
assert_eq!(app.pivot_tool, pivot);
|
||||
}
|
||||
assert_eq!(app.layout.layers(), &before);
|
||||
assert_eq!(app.layout.formats(), &formats);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn latched_grid_and_pivot_resize_together_and_modifier_release_restores_grid() {
|
||||
for spacing in [10, 100] {
|
||||
let mut app = Editor {
|
||||
grid_tool: Some(spacing),
|
||||
pivot_tool: true,
|
||||
..Default::default()
|
||||
};
|
||||
let before = app.layout.layers().clone();
|
||||
let original = before[1];
|
||||
app.layout
|
||||
.start_handle_resize(1, ResizeHandle::Right, [1800.0, 360.0], true);
|
||||
app.layout.set_resize_pivot([0.25, 0.75]);
|
||||
let fixed = [
|
||||
original.x + original.width * 0.25,
|
||||
original.y + original.height * 0.75,
|
||||
];
|
||||
let guides = app.drag_with_modifiers([1837.0, 360.0], egui::Modifiers::NONE, 1.0);
|
||||
let target = (1837.0 / spacing as f64).round() * spacing as f64;
|
||||
assert_eq!(guides[0], Some(target));
|
||||
let g = app.layout.layers()[1];
|
||||
assert!((g.x + g.width - target).abs() < 1e-7);
|
||||
assert!((g.x + g.width * 0.25 - fixed[0]).abs() < 1e-7);
|
||||
assert!((g.y + g.height * 0.75 - fixed[1]).abs() < 1e-7);
|
||||
app.layout.cancel_drag();
|
||||
app.layout.start_drag([1160.0, 180.0]);
|
||||
let modifiers = egui::Modifiers {
|
||||
shift: true,
|
||||
ctrl: spacing == 100,
|
||||
..Default::default()
|
||||
};
|
||||
app.drag_with_modifiers([1173.0, 217.0], modifiers, 1.0);
|
||||
assert_eq!(app.layout.layers()[1].x, 1173.0);
|
||||
app.drag_with_modifiers([1173.0, 217.0], egui::Modifiers::NONE, 1.0);
|
||||
assert_eq!(
|
||||
app.layout.layers()[1].x,
|
||||
(1173.0 / spacing as f64).round() * spacing as f64
|
||||
);
|
||||
app.layout.finish_drag();
|
||||
app.layout.undo();
|
||||
assert_eq!(app.layout.layers(), &before);
|
||||
assert_eq!(app.grid_tool, Some(spacing));
|
||||
assert!(app.pivot_tool);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn linked_pivot_markers_reflect_and_can_be_moved_from_either_layer() {
|
||||
for mode in [ResizeMode::Same, ResizeMode::Mirror, ResizeMode::Opposite] {
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ impl Editor {
|
|||
self.snapping_options(ui);
|
||||
ui.weak("Applies to layer movement/resize, not numeric entry or crop-content handles.");
|
||||
ui.separator();
|
||||
ui.label("Ctrl: show/move resize pivot · Ctrl-resize: keep pivot fixed");
|
||||
ui.label("Double-click pivot: reset to center · Ctrl+Shift: 100 px grid");
|
||||
ui.label("Ctrl: temporarily invert Pivot tool · Drag pivot to position");
|
||||
ui.label("Double-click pivot: reset to center · Shift/Ctrl+Shift: invert matching grid tool");
|
||||
ui.label("Arrow keys: move 1 pixel · Shift-arrow: move 10 pixels");
|
||||
ui.label("Shift-click: add/remove a layer from selection");
|
||||
ui.label("Space-drag or middle button: pan · Scroll: zoom");
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ impl Editor {
|
|||
settings: std::mem::take(&mut self.settings),
|
||||
snapping: self.snapping,
|
||||
resize_mode: self.resize_mode,
|
||||
grid_tool: self.grid_tool,
|
||||
pivot_tool: self.pivot_tool,
|
||||
layout,
|
||||
reference,
|
||||
corner: e.position_point,
|
||||
|
|
@ -296,11 +298,15 @@ mod tests {
|
|||
for mode in [ResizeMode::Same, ResizeMode::Mirror, ResizeMode::Opposite] {
|
||||
let mut app = Editor {
|
||||
resize_mode: mode,
|
||||
grid_tool: Some(100),
|
||||
pivot_tool: true,
|
||||
..Default::default()
|
||||
};
|
||||
app.install_project(&ctx, Project::from_layout(&Layout::default()))
|
||||
.unwrap();
|
||||
assert_eq!(app.resize_mode, mode);
|
||||
assert_eq!(app.grid_tool, Some(100));
|
||||
assert!(app.pivot_tool);
|
||||
assert_eq!(app.active_resize_mode(), ResizeMode::Individual);
|
||||
app.layout.set_selection([true; 2]);
|
||||
app.sync();
|
||||
|
|
|
|||
|
|
@ -105,12 +105,10 @@ fixed six-logical-pixel proximity radius converted by viewport scale. It affects
|
|||
layer movement and resize handles; numeric entry, nudges and crop-content gestures
|
||||
bypass it. Resize snapping preserves anchors and proportions and shows guides only
|
||||
when the resulting edge actually reaches its target.
|
||||
Shift temporarily overrides snapping with a 10-screen-pixel grid for layer movement and resizing; Ctrl+Shift uses 100 pixels. Alt overrides both grids and temporarily inverts the saved snapping-enabled value (off becomes on; on becomes off), including on release. The chosen pixel/screen/layer-edge targets still apply. These modifiers do not change the saved options or settings version.
|
||||
The session-only toolbar grid tools select 10 or 100 screen pixels (mutually exclusive). Shift temporarily selects the 10 px grid; Ctrl+Shift selects 100 px. If that same grid tool is selected, the matching shortcut temporarily disables it instead. Alt overrides both grids and temporarily inverts the saved snapping-enabled value (off becomes on; on becomes off), including on release. The chosen pixel/screen/layer-edge targets still apply. These modifiers do not change the saved options or settings version.
|
||||
|
||||
**Settings → Midra integration → Allow sending to Program** saves immediately. Restore default settings disables it. Projects do not override this application preference; the Preview/Program destination itself remains session-only.
|
||||
|
||||
**Try autoconnecting at startup** is in Settings → Midra integration. It saves immediately but applies on the next launch; toggling it does not initiate a connection. One background attempt uses the regular connection timeout and error handling, with no automatic retry loop. Failures leave the app offline and are reported in Midra connection. Project loading does not trigger an attempt.
|
||||
|
||||
Ctrl without Shift shows temporary per-selection resize pivots and activates pivot
|
||||
anchoring during layer handle resizing. Pivot positions are not application settings
|
||||
and are not persisted. Ctrl+Shift retains its 100 px grid and normal resize anchors.
|
||||
The session-only Pivot tool can combine with either grid. Ctrl without Shift temporarily inverts Pivot; Ctrl+Shift does not affect it. Pivot positions and tool selections are not persisted in application settings or projects. Tool selections survive project loads and selection changes within a session, and start off on launch; pivot positions reset on selection changes/project loads.
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ missing fields and non-finite values are rejected before replacing the document.
|
|||
Projects larger than 96 MiB are rejected.
|
||||
|
||||
Save includes **applied values only**. Pending text/format/import drafts, open
|
||||
dialogs, undo/redo history, crop-edit mode, resize mode, temporary resize pivots, and provisional device
|
||||
dialogs, undo/redo history, crop-edit mode, resize mode, temporary resize pivots, grid/pivot tool selections, and provisional device
|
||||
export calculations are not persisted. The current resize mode stays selected
|
||||
when opening another project in the same session; a fresh launch starts with
|
||||
Individual mode. Names and folder labels are stored. Removing layers does not renumber surviving
|
||||
|
|
|
|||
|
|
@ -284,14 +284,36 @@ Files are limited to 64 MiB and dimensions to 8192 pixels per side or the GPU's
|
|||
texture limit, whichever is smaller. Invalid imports keep the previous image.
|
||||
Reference settings are session-only and independent of layer undo/redo.
|
||||
|
||||
### Persistent editing tools
|
||||
|
||||
The toolbar has **10 px grid**, **100 px grid**, and **Pivot** icon toggles.
|
||||
Click again to turn a tool off. Only one grid can stay selected; Pivot can combine
|
||||
with either. A cyan outline marks the selected toggle; the fill shows its current
|
||||
effect, including temporary modifier changes. Tooltips explain the shortcuts.
|
||||
Icons wrap onto another row when the window is narrow.
|
||||
|
||||
| Held modifier | Temporary effect |
|
||||
| --- | --- |
|
||||
| Shift | 10 px grid; disables it if that grid is already selected |
|
||||
| Ctrl+Shift | 100 px grid; disables it if that grid is already selected |
|
||||
| Ctrl without Shift | Inverts Pivot on/off |
|
||||
| Alt | Overrides either grid and inverts ordinary snapping |
|
||||
|
||||
A different grid shortcut temporarily replaces the selected grid. Ctrl+Shift does
|
||||
not invert Pivot, so a selected Pivot tool can combine with the 100 px grid.
|
||||
Releasing modifiers restores the selected tools, including during a drag. Tools
|
||||
stay selected across selection changes and project loads in this session; they
|
||||
are not saved to projects/settings and start off on launch. They affect layer
|
||||
movement/resize, not numeric edits or crop-content handles.
|
||||
|
||||
### Ctrl resize pivot
|
||||
|
||||
Hold **Ctrl** to show a draggable crosshair pivot on selected layers (center by
|
||||
With Pivot off, hold **Ctrl** (or select **Pivot**) to show a draggable crosshair on selected layers (center by
|
||||
default). Drag the marker to place it, including outside the layer; this does not
|
||||
change the document. Double-click it while holding Ctrl to reset to center.
|
||||
change the document. Double-click the visible pivot to reset to center.
|
||||
**Ctrl-drag a layer resize handle** to resize around the fixed pivot. Ctrl can be
|
||||
pressed/released during the gesture; the result is recalculated from the starting
|
||||
geometry. Release Ctrl for the normal opposite-edge anchor. Escape cancels a
|
||||
geometry. With Pivot selected, Ctrl temporarily restores the normal opposite-edge anchor. Escape cancels a
|
||||
resize or restores the previous pivot placement.
|
||||
|
||||
| Resize mode | Pivot behavior |
|
||||
|
|
@ -306,7 +328,7 @@ while resizing; unequal sizes retain proportional scaling. Aspect-ratio lock,
|
|||
snapping (including edge contact), Alt inversion and Undo still apply. A handle
|
||||
on the pivot's axis cannot resize that axis; move the pivot or use another handle.
|
||||
Layers do not flip when dragged through the pivot; minimum sizes still apply.
|
||||
**Ctrl+Shift remains the 100 px grid**, using normal anchors. Pivots are temporary,
|
||||
**Ctrl+Shift remains the 100 px grid** (or temporarily disables a selected 100 px grid); it uses pivot anchoring if Pivot is selected. Pivot positions are temporary,
|
||||
reset on selection changes/project loads, and follow layers when moved. They are
|
||||
not saved and do not affect numeric sizing or Adjust layer crop mode.
|
||||
|
||||
|
|
@ -694,7 +716,7 @@ no layer mapping.
|
|||
Layer rows use padlock and eye icon buttons for locking and visibility, with tooltips and highlighted locked/hidden states. Double-click a layer name in the right-hand list to rename it. Enter saves, Escape or Cancel discards the edit; names must contain 1–128 characters. Renaming preserves the layer ID and folder and supports Undo.
|
||||
|
||||
Hold **Shift** while moving or resizing layers to snap to a **10 px grid**;
|
||||
**Ctrl+Shift** uses a **100 px grid**. These temporary grids override ordinary
|
||||
**Ctrl+Shift** uses a **100 px grid**. A matching selected grid tool is temporarily disabled instead; a different shortcut temporarily switches grid size. These grids override ordinary
|
||||
pixel/edge snapping, even when snapping is disabled in Settings. **Alt**
|
||||
overrides both grids and temporarily inverts ordinary snapping. The modifier state on release determines the final position.
|
||||
Grid coordinates are screen pixels measured from the screen's top-left, independent
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Add persistent 10 px/100 px grid and Pivot toolbar icons with shortcut tooltips. Grids exclude each other; Pivot combines with either. Matching modifiers temporarily invert toggles; choices last for the session.
|
||||
|
||||
- Ctrl shows a movable resize pivot; Ctrl-resize keeps it fixed. Same/Mirror/Opposite modes share or reflect relative pivots. Double-click resets; Ctrl+Shift keeps the 100 px grid. Session-only, with snapping and Undo.
|
||||
|
||||
- Hold Alt to temporarily invert movement/resize snapping (on ↔ off), overriding Shift grids without changing saved settings.
|
||||
|
|
|
|||
Loading…
Reference in New Issue