ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/background
(Generate patch)

Comparing rxvt-unicode/src/perl/background (file contents):
Revision 1.43 by root, Sun Jun 10 11:23:20 2012 UTC vs.
Revision 1.44 by root, Sun Jun 10 11:31:22 2012 UTC

552 552
553Example: move the image right by 20 pixels and down by 30. 553Example: move the image right by 20 pixels and down by 30.
554 554
555 move 20, 30, ... 555 move 20, 30, ...
556 556
557=item center $img
558
559=item center $width, $height, $img
560
561Centers the image, i.e. the center of the image is moved to the center of
562the terminal window (or the box specified by C<$width> and C<$height> if
563given).
564
557=item rootalign $img 565=item rootalign $img
558 566
559Moves the image so that it appears glued to the screen as opposed to the 567Moves the image so that it appears glued to the screen as opposed to the
560window. This gives the illusion of a larger area behind the window. It is 568window. This gives the illusion of a larger area behind the window. It is
561exactly equivalent to C<move -TX, -TY>, that is, it moves the image to the 569exactly equivalent to C<move -TX, -TY>, that is, it moves the image to the
574 582
575 sub move($$;$) { 583 sub move($$;$) {
576 my $img = pop->clone; 584 my $img = pop->clone;
577 $img->move ($_[0], $_[1]); 585 $img->move ($_[0], $_[1]);
578 $img 586 $img
587 }
588
589 sub center($;$$) {
590 my $img = pop;
591 my $w = $_[0] || TW;
592 my $h = $_[0] || TH;
593
594 move 0.5 * ($w - $img->w), 0.5 * ($h - $img->h), $img
579 } 595 }
580 596
581 sub rootalign($) { 597 sub rootalign($) {
582 move -TX, -TY, $_[0] 598 move -TX, -TY, $_[0]
583 } 599 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines