From f922efaa04b8e2ed1eb162bab3422015c1b5bfc9 Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 9 Nov 2007 14:28:40 +0000 Subject: Robustesse pour MMultiSelection MAntiRecouvrement Ajout d'une fonctionnalite utile pour la reco d'ecriture dans MWritable Ajout de la possibilite de passer en parametre une fonction "translate" particuliere dans le MMover --- src/MTools/Comp/MMover.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/MTools/Comp/MMover.pm') diff --git a/src/MTools/Comp/MMover.pm b/src/MTools/Comp/MMover.pm index 0d2628c..6097bd9 100644 --- a/src/MTools/Comp/MMover.pm +++ b/src/MTools/Comp/MMover.pm @@ -55,6 +55,7 @@ sub new { $self -> recordProperty ('y', 0); $self -> recordProperty ('targets', $targets); $self -> recordProperty ('allower', undef); + $self -> recordProperty ('translate', 'translate'); $self -> mconfigure (%options); @@ -79,17 +80,18 @@ sub setPos { my $dy = $y - $self -> mget ('y'); my $tgs = $self -> mget ('targets'); my @targets; + my $translate_cbk = $self -> mget ('translate'); if (ref ($tgs) eq 'ARRAY') { @targets = @{$tgs}; for (my $i = 0; $i < @targets; $i++) { - $targets [$i] -> translate ($dx, $dy); + $targets [$i] -> $translate_cbk ($dx, $dy); } } else { - $tgs -> translate ($dx, $dy); + $tgs -> $translate_cbk ($dx, $dy); } $self -> mconfigure ('x', $x); $self -> mconfigure ('y', $y); -- cgit v1.1