in reply to Re: Total Newbies TkZinc questions
in thread Total Newbies TkZinc questions
Answering my own questions, indeed it took a few hours to figure out ;-) The dragging issue is solved by the zinc->transform() command, like magic! Here is some pseudocode in case someone else ponders this, I suppose it's obvious to the gurus.. :-\
# -- PSEUDOCODE, DOES NOT WORK -- my ($dx, $dy); sub mobile_start { my $ev = $zinc->XEvent; ($dx, $dy) = $zinc->transform(1, $scaled_group, [$ev->x, $ev->y]); } sub mobile_move { my $ev = $zinc->XEvent; my ($tr_evx, $tr_evy) = $zinc->transform(1, $scaled_group, [$ev->x, +$ev->y]); $zinc->translate($some_group, $tr_evx-$dx, $tr_evy-$dy); ($dx, $dy) = ($tr_evx, $tr_evy); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Total Newbies TkZinc questions
by zentara (Cardinal) on Oct 22, 2008 at 13:19 UTC | |
by rocklee (Beadle) on Oct 22, 2008 at 18:32 UTC | |
by zentara (Cardinal) on Oct 22, 2008 at 19:05 UTC |