Commit df1e51d9 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*fixed incosistent displace of Jonathan's matrix transformed scalars

*added getscroll after redrawing gop and scalars that have been changed via properties dialog in case their xy positions changed
parent 1a5eee8c
......@@ -1052,6 +1052,9 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
tag, x1, y1, x2, y2);
if (glist_isselected(parent_glist, gr))
gobj_select(gr, parent_glist, 1);
// here we check for changes in scrollbar because of legacy
// objects that can fall outside gop window, e.g. scalars
canvas_getscroll(glist_getcanvas(x->gl_owner));
//fprintf(stderr,"******************graph_vis SELECT\n");
}
else
......@@ -1063,6 +1066,9 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
glist_eraseiofor(parent_glist, &x->gl_obj, tag);
for (g = x->gl_list; g; g = g->g_next)
gobj_vis(g, x, 0);
// here we check for changes in scrollbar because of legacy
// objects that can fall outside gop window, e.g. scalars
canvas_getscroll(glist_getcanvas(x->gl_owner));
}
}
......
......@@ -354,6 +354,8 @@ void canvas_dataproperties(t_canvas *x, t_scalar *sc, t_binbuf *b)
}
else newone->g_next = x->gl_list, x->gl_list = newone;
}
// here we check for changes in scrollbar due to potential repositioning
canvas_getscroll(x);
didit:
;
}
......
......@@ -473,14 +473,29 @@ void scalar_select(t_gobj *z, t_glist *owner, int state)
glist_getcanvas(owner), x);
sys_vgui(".x%lx.c addtag scalar_selected withtag {.scalar%lx}\n",
glist_getcanvas(owner), x->sc_vec);
if (x->sc_selected != glist_getcanvas(owner))
{
// we are inside gop
sys_vgui(".x%lx.c addtag scalarGOP withtag blankscalar%lx\n",
glist_getcanvas(owner), x);
sys_vgui(".x%lx.c addtag scalarGOP withtag {.scalar%lx}\n",
glist_getcanvas(owner), x->sc_vec);
}
}
else
{
x->sc_selected = 0;
sys_vgui(".x%lx.c dtag blankscalar%lx selected\n",
glist_getcanvas(owner), x);
sys_vgui(".x%lx.c dtag .scalar%lx scalar_selected\n",
glist_getcanvas(owner), x->sc_vec);
if (x->sc_selected != glist_getcanvas(owner))
{
sys_vgui(".x%lx.c dtag blankscalar%lx scalarGOP\n",
glist_getcanvas(owner), x);
sys_vgui(".x%lx.c dtag .scalar%lx scalarGOP\n",
glist_getcanvas(owner), x->sc_vec);
}
x->sc_selected = 0;
}
//sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n",
// glist_getcanvas(owner), owner, state);
......
......@@ -8157,18 +8157,26 @@ proc pdtk_canvas_update_sticky_tip {w} {
}
# move normal selected items and add (dx, dy) to selected scalars' matrices
proc pdtk_canvas_displace_withtag {w dx dy} {
#puts stderr "pdtk_canvas_displace_withtag $dx $dy"
$w move selected $dx $dy
foreach item [$w find withtag scalar_selected] {
foreach item [$w find withtag {scalar_selected&&!scalarGOP}] {
set matrix [lindex [$w itemconfigure $item -matrix] 4]
#puts stderr "A:$matrix"
set newx [expr {[lindex $matrix 2 0] + $dx}]
set newy [expr {[lindex $matrix 2 1] + $dy}]
#set newx [expr {[lindex $matrix 2 0] + ($dx * [expr 1.0-[lindex $matrix 0 0]])}]
#set newy [expr {[lindex $matrix 2 1] + ($dy * [expr 1.0-[lindex $matrix 1 1]])}]
set matrix [lreplace $matrix 2 2 [list $newx $newy]]
#puts stderr "B:$matrix"
$w itemconfigure $item -matrix $matrix
}
foreach item [$w find withtag {scalar_selected&&scalarGOP}] {
set matrix [lindex [$w itemconfigure $item -matrix] 4]
#puts stderr "C:$matrix"
set newx [expr {[lindex $matrix 2 0] + ($dx * [expr 1.0-[lindex $matrix 0 0]])}]
set newy [expr {[lindex $matrix 2 1] + ($dy * [expr 1.0-[lindex $matrix 1 1]])}]
set matrix [lreplace $matrix 2 2 [list $newx $newy]]
#puts stderr "D:$matrix"
$w itemconfigure $item -matrix $matrix
}
}
# move activewidth to toggle on editmode?
......
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