mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Use the internal command argument for the Warp pick
This commit is contained in:
1 parent
a4f869fe51
commit
608760bf21
2 files changed
+2
-2
No files matched your search
@@ -638,7 +638,7 @@ fn split(s: &mut Session, p: &Value, cmd: &str, how: Split) -> Result<Value> {
|
||||
if let Some(w) = inline_warp(cmd, p)? {
|
||||
// Only the canvas's inline warp uses a grid pick. Commands on a stored smart object
|
||||
// continue to take document coordinates.
|
||||
let picked = p.get("pickedAnchor").and_then(Value::as_u64).and_then(|i| usize::try_from(i).ok());
|
||||
let picked = p.get("_pickedAnchor").and_then(Value::as_u64).and_then(|i| usize::try_from(i).ok());
|
||||
let out = split_warp_inner(&w, at, how, picked).ok_or_else(|| bad(cmd, "nothing to split or remove there"))?;
|
||||
return Ok(json!({"warp": out}));
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ pub fn split(app: &mut PhotocraftApp, id: &str, at: Option<[f64; 2]>) -> Result<
|
||||
&& let (Some(pv), Some(warp)) = (&app.transform_preview, app.ui.transform.as_ref().and_then(|t| t.session.warp()))
|
||||
&& let Some(picked) = pv.warp_grid.picked(warp)
|
||||
{
|
||||
p["pickedAnchor"] = json!(picked);
|
||||
p["_pickedAnchor"] = json!(picked);
|
||||
}
|
||||
edit_session_warp(app, id, &p)
|
||||
}
|
||||
Reference in new issue
Block a user