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

Comparing deliantra/Deliantra/Deliantra/MapWidget.pm (file contents):
Revision 1.10 by root, Tue Feb 7 04:03:50 2006 UTC vs.
Revision 1.11 by root, Tue Feb 7 16:53:45 2006 UTC

282 $self->{x} = 282 $self->{x} =
283 $self->{y} = 0; 283 $self->{y} = 0;
284 284
285 delete $self->{face}; 285 delete $self->{face};
286 $self->update_map (0, 0, $self->{width}, $self->{height}); 286 $self->update_map (0, 0, $self->{width}, $self->{height});
287 delete $self->{tipinfo}; 287 delete $self->{tipinfo}; $self->update_tooltip;
288 $self->update_tooltip;
289 $self->invalidate_all; 288 $self->invalidate_all;
290} 289}
291 290
292sub coord { 291sub coord {
293 my ($self, $x, $y) = @_; 292 my ($self, $x, $y) = @_;
391 my ($x, $y, $idx) = @$_; 390 my ($x, $y, $idx) = @$_;
392 391
393 push @{ $ov->[$x][$y] }, $idx; 392 push @{ $ov->[$x][$y] }, $idx;
394 } 393 }
395 394
395 delete $self->{tipinfo}; $self->update_tooltip;
396
396 $self->queue_draw_area ($x * TILESIZE - $self->{x}, 397 $self->queue_draw_area ($x * TILESIZE - $self->{x},
397 $y * TILESIZE - $self->{y}, 398 $y * TILESIZE - $self->{y},
398 $w * TILESIZE, $h * TILESIZE); 399 $w * TILESIZE, $h * TILESIZE);
399} 400}
400 401
405 406
406 my $ox = $self->{x}; my $ix = int $ox / TILESIZE; 407 my $ox = $self->{x}; my $ix = int $ox / TILESIZE;
407 my $oy = $self->{y}; my $iy = int $oy / TILESIZE; 408 my $oy = $self->{y}; my $iy = int $oy / TILESIZE;
408 409
409 # get_rectangles is buggy in older versions 410 # get_rectangles is buggy in older versions
410 for my $area ($Gtk2::VERSION > 1.115 ? $event->region->get_rectangles : $event->area) { 411 my @rectangles = $Gtk2::VERSION > 1.115
412 ? $event->region->get_rectangles : $event->area;
413
414 @rectangles = $event->area
415 if @rectangles > 4;
416
417 for my $area (@rectangles) {
411 my ($x, $y, $w, $h) = $area->values; # x y w h 418 my ($x, $y, $w, $h) = $area->values; # x y w h
412 419
413 my @x = ((int ($ox + $x) / TILESIZE) .. int +($ox + $x + $w + TILESIZE - 1) / TILESIZE); 420 my @x = ((int ($ox + $x) / TILESIZE) .. int +($ox + $x + $w + TILESIZE - 1) / TILESIZE);
414 my @y = ((int ($oy + $y) / TILESIZE) .. int +($oy + $y + $h + TILESIZE - 1) / TILESIZE); 421 my @y = ((int ($oy + $y) / TILESIZE) .. int +($oy + $y + $h + TILESIZE - 1) / TILESIZE);
415 422

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines