mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Merge #15020 into the merge queue batch
Warp Cylinder: the bottom handle sets the lower depth only, corners keep the depth in pixels, wrap 0.9, square handles
This commit is contained in:
commit
50150d942b
1 file changed
+4
-4
@@ -1999,9 +1999,9 @@ fn warp_mode_drags_a_cylinders_handles_and_commits_it_as_a_cylinder() {
|
||||
settle(&mut app);
|
||||
// The wrap handle, dragged 3 px right: a quarter of the 12 px half axis further along.
|
||||
let mut wrapped = cylinder_of(&app);
|
||||
wrapped[6] = 0.6;
|
||||
wrapped[6] = v0[6] - 0.25;
|
||||
drag_cylinder(&mut app, 2, wrapped);
|
||||
assert!((cylinder_of(&app)[6] - 0.6).abs() < 1e-9, "{:?}", cylinder_of(&app));
|
||||
assert!((cylinder_of(&app)[6] - wrapped[6]).abs() < 1e-9, "{:?}", cylinder_of(&app));
|
||||
settle(&mut app);
|
||||
// A drag on the surface moves the whole cylinder.
|
||||
let before = cylinder_of(&app);
|
||||
@@ -2016,9 +2016,9 @@ fn warp_mode_drags_a_cylinders_handles_and_commits_it_as_a_cylinder() {
|
||||
let _ = intercept(&mut app, "edit.undo");
|
||||
assert_eq!(cylinder_of(&app), before, "undo takes back the move");
|
||||
let _ = intercept(&mut app, "edit.undo");
|
||||
assert!((cylinder_of(&app)[6] - 0.85).abs() < 1e-9, "undo takes back the wrap: {:?}", cylinder_of(&app));
|
||||
assert!((cylinder_of(&app)[6] - v0[6]).abs() < 1e-9, "undo takes back the wrap: {:?}", cylinder_of(&app));
|
||||
let _ = intercept(&mut app, "edit.redo");
|
||||
assert!((cylinder_of(&app)[6] - 0.6).abs() < 1e-9, "redo: {:?}", cylinder_of(&app));
|
||||
assert!((cylinder_of(&app)[6] - wrapped[6]).abs() < 1e-9, "redo: {:?}", cylinder_of(&app));
|
||||
let v = cylinder_of(&app);
|
||||
let steps = app.session.active().unwrap().history.past_len();
|
||||
commit(&mut app);
|
||||
|
||||
Reference in new issue
Block a user