… | |
… | |
519 | ); |
519 | ); |
520 | } |
520 | } |
521 | } |
521 | } |
522 | |
522 | |
523 | # then the small stones (always using the first image) |
523 | # then the small stones (always using the first image) |
524 | for ([MARK_SMALL_B, $black_img[0]], |
524 | for ([MARK_SMALL_B, $mark & MARK_GRAYED ? 106 : 255, $black_img[0]], |
525 | [MARK_SMALL_W, $white_img[0]]) { |
525 | [MARK_SMALL_W, $mark & MARK_GRAYED ? 190 : 255,$white_img[0]]) { |
526 | my ($mask, $img) = @$_; |
526 | my ($mask, $alpha, $img) = @$_; |
527 | if ($mark & $mask) { |
527 | if ($mark & $mask) { |
528 | $img->composite ( |
528 | $img->composite ( |
529 | $base, ($size / 4) x2, (ceil $size / 2 + 1) x2, ($size / 4) x2, |
529 | $base, ($size / 4) x2, (ceil $size / 2 + 1) x2, ($size / 4) x2, |
530 | $size / $img->get_width / 2, $size / $img->get_height / 2, |
530 | $size / $img->get_width / 2, $size / $img->get_height / 2, |
531 | 'bilinear', 255 |
531 | 'bilinear', $alpha |
532 | ); |
532 | ); |
533 | } |
533 | } |
534 | } |
534 | } |
535 | |
535 | |
536 | # and finally any markers |
536 | # and finally any markers |
… | |
… | |
638 | |
638 | |
639 | my $x = int (($x - $self->{kx}[0]) * $size / ($self->{kx}[$size] - $self->{kx}[0]) + 0.5) - 1; |
639 | my $x = int (($x - $self->{kx}[0]) * $size / ($self->{kx}[$size] - $self->{kx}[0]) + 0.5) - 1; |
640 | my $y = int (($y - $self->{ky}[0]) * $size / ($self->{ky}[$size] - $self->{ky}[0]) + 0.5) - 1; |
640 | my $y = int (($y - $self->{ky}[0]) * $size / ($self->{ky}[$size] - $self->{ky}[0]) + 0.5) - 1; |
641 | |
641 | |
642 | my $pos = $self->{cursorpos}; |
642 | my $pos = $self->{cursorpos}; |
643 | if ($x != $pos->[0] || $y != $pos->[1]) { |
643 | if ((not (defined $pos) && $x >= 0 && $x < $size && $y >= 0 && $y < $size) |
|
|
644 | || $x != $pos->[0] |
|
|
645 | || $y != $pos->[1]) { |
644 | |
646 | |
645 | $self->cursor (0); |
647 | $self->cursor (0); |
646 | |
648 | |
647 | if ($x >= 0 && $x < $size |
649 | if ($x >= 0 && $x < $size |
648 | && $y >= 0 && $y < $size) { |
650 | && $y >= 0 && $y < $size) { |