Commit d811c6be authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix undo/redo behavior for resizing gop subcanvas

parent 9734acb5
......@@ -2342,10 +2342,11 @@ post("clickhook");
if (sh->h_scale)
sh->h_scale = newstate;
/* set undo for this canvas if we're moving or resizing the red rectangle.
Otherwise, we're resizing our gop canvas on the parent, so set undo
for our toplevel canvas. */
canvas_undo_add(x, 8, "apply", canvas_undo_set_canvas(x));
/* So ugly: if the user is dragging the bottom right-hand corner of
a gop subcanvas on the parent, we already set an undo event for it.
So we only add one here if we're dragging the gop red rectangle. */
if (sh->h_scale != 2) /* moving/resizing a red gop rect */
canvas_undo_add(x, 8, "apply", canvas_undo_set_canvas(x));
if (sh->h_scale == 1) /* resize gop hook for (red) gop rect */
......@@ -3424,13 +3424,11 @@ fprintf(stderr, "inside textedfor canvas_class\n");
x->gl_editor->e_ywas = y1;
x->gl_editor->e_xnew = xpos;
x->gl_editor->e_ynew = ypos;
if (ob->ob_pd != canvas_class ||
!((t_canvas *)ob)->gl_isgraph)
canvas_undo_add(x, 6, "resize",
canvas_undo_set_apply(x, glist_getindex(x, y)));
canvas_undo_add(x, 6, "resize",
canvas_undo_set_apply(x, glist_getindex(x, y)));
/* We've got an iemgui style scalehandle for gop canvases */
if (ob->ob_pd == canvas_class &&
((t_canvas *)ob)->gl_isgraph)
t_pd *sh = (t_pd *)((t_canvas *)ob)->x_handle;
pd_vmess(sh, gensym("_click"), "fff",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment