--- deliantra/Deliantra-Client/DC/UI.pm 2006/07/23 04:37:51 1.330 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/07/23 04:46:02 1.331 @@ -431,6 +431,8 @@ sub coord2local { my ($self, $x, $y) = @_; + Carp::confess unless $self->{parent};#d# + $self->{parent}->coord2local ($x - $self->{x}, $y - $self->{y}) } @@ -496,11 +498,18 @@ push @{ $self->{signal_cb}{$signal} }, $cb; } +my %has_coords = ( + button_down => 1, + button_up => 1, + mouse_motion => 1, + mouse_wheel => 1, +); + sub emit { my ($self, $signal, @args) = @_; my @append - = ref $args[0] && $args[0]->isa ("CFClient::UI::Event") + = $has_coords{$signal} ? $args[0]->xy ($self) : ();