mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 02:35:37 +01:00
Merge pull request #10297 from storytold/fix/vectorcraft-effect-preview-canvas
Keep the canvas visible while previewing built-in effects
This commit is contained in:
1 file changed
+5
@@ -350,9 +350,14 @@ fn launch(app: &mut VectorcraftApp, mut open: Open, baseline: Map<String, Value>
|
||||
// Free Distort's Reset puts the corners back on the box, wherever they were when it opened.
|
||||
let reset_to = (id == super::free_distort::FREE_DISTORT)
|
||||
.then(|| form::fields_of(&rows, &Map::from_iter([("corners".to_string(), json!(super::free_distort::IDENTITY))])));
|
||||
let canvas = crate::doc_windows::current(app).map(crate::canvas::canvas_id);
|
||||
let dialog = HostedParamDialog::new(&ctx, "effect", fields, move |f| {
|
||||
let rows = effect_params(&cx, f);
|
||||
let dialog = ParamDialog::new("effect", title.clone(), rows).values(Bind::bound(f)).previews(true);
|
||||
let dialog = match canvas {
|
||||
Some(canvas) => dialog.canvas(canvas),
|
||||
None => dialog,
|
||||
};
|
||||
let dialog = match &reset_to {
|
||||
Some(target) => dialog.reset_to(target.clone()),
|
||||
None => dialog,
|
||||
|
||||
Reference in new issue
Block a user