ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.377 by root, Mon Jul 16 20:20:30 2007 UTC vs.
Revision 1.378 by root, Mon Jul 16 20:22:39 2007 UTC

986} 986}
987 987
988sub set_offset { 988sub set_offset {
989 my ($self, $x, $y) = @_; 989 my ($self, $x, $y) = @_;
990 990
991 $self->{view_x} = max 0, min $self->child->{w} - $self->{w}, int $x; 991 my $x = max 0, min $self->child->{w} - $self->{w}, int $x;
992 $self->{view_y} = max 0, min $self->child->{h} - $self->{h}, int $y; 992 my $y = max 0, min $self->child->{h} - $self->{h}, int $y;
993 993
994 $self->emit (changed => $self->{view_x}, $self->{view_y}); 994 if ($x != $self->{view_x} or $y != $self->{view_y}) {
995 $self->{view_x} = $x;
996 $self->{view_y} = $y;
997
998 $self->emit (changed => $x, $y);
995 $self->update; 999 $self->update;
1000 }
996} 1001}
997 1002
998# hmm, this does not work for topleft of $self... but we should not ask for that 1003# hmm, this does not work for topleft of $self... but we should not ask for that
999sub coord2local { 1004sub coord2local {
1000 my ($self, $x, $y) = @_; 1005 my ($self, $x, $y) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines