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

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.67 by sf-exg, Mon Oct 4 21:56:42 2010 UTC vs.
Revision 1.68 by sf-exg, Mon Oct 4 21:57:41 2010 UTC

458 { 458 {
459 w = h_scale * target_width / 100; 459 w = h_scale * target_width / 100;
460 h = v_scale * target_height / 100; 460 h = v_scale * target_height / 100;
461 } 461 }
462 462
463 if (!w) w = image_width;
464 if (!h) h = image_height;
465
463 if (flags & rootAlign) 466 if (flags & rootAlign)
464 { 467 {
465 target->get_window_origin (x, y); 468 target->get_window_origin (x, y);
466 x = -x; 469 x = -x;
467 y = -y; 470 y = -y;
468 } 471 }
469 else 472 else
470 { 473 {
471 x = make_align_position (h_align, target_width, w > 0 ? w : image_width); 474 x = make_align_position (h_align, target_width, w);
472 y = make_align_position (v_align, target_height, h > 0 ? h : image_height); 475 y = make_align_position (v_align, target_height, h);
473 } 476 }
474 477
475 flags &= ~sizeSensitive; 478 flags &= ~sizeSensitive;
476 if (h_scale != 0 || v_scale != 0 479 if (h_scale != 0 || v_scale != 0
477 || h_align != 0 || v_align != 0 480 || h_align != 0 || v_align != 0
542 545
543 if (!original_asim 546 if (!original_asim
544 || (!(flags & rootAlign) 547 || (!(flags & rootAlign)
545 && (x >= target_width 548 && (x >= target_width
546 || y >= target_height 549 || y >= target_height
547 || (w > 0 && x + w <= 0)
548 || (h > 0 && y + h <= 0)))) 550 || (x + w <= 0)
551 || (y + h <= 0))))
549 { 552 {
550 if (background) 553 if (background)
551 { 554 {
552 new_pmap_width = background->width; 555 new_pmap_width = background->width;
553 new_pmap_height = background->height; 556 new_pmap_height = background->height;
567 } 570 }
568 else 571 else
569 { 572 {
570 result = original_asim; 573 result = original_asim;
571 574
572 if ((w > 0 && w != original_asim->width) 575 if ((w != original_asim->width)
573 || (h > 0 && h != original_asim->height)) 576 || (h != original_asim->height))
574 { 577 {
575 result = scale_asimage (target->asv, original_asim, 578 result = scale_asimage (target->asv, original_asim,
576 w > 0 ? w : original_asim->width, 579 w, h,
577 h > 0 ? h : original_asim->height,
578 background ? ASA_ASImage : ASA_XImage, 580 background ? ASA_ASImage : ASA_XImage,
579 100, ASIMAGE_QUALITY_DEFAULT); 581 100, ASIMAGE_QUALITY_DEFAULT);
580 } 582 }
581 583
582 if (background == NULL) 584 if (background == NULL)
763 get_image_geometry (image_width, image_height, w, h, x, y); 765 get_image_geometry (image_width, image_height, w, h, x, y);
764 766
765 if (!(flags & rootAlign) 767 if (!(flags & rootAlign)
766 && (x >= target_width 768 && (x >= target_width
767 || y >= target_height 769 || y >= target_height
768 || (w > 0 && x + w <= 0)
769 || (h > 0 && y + h <= 0))) 770 || (x + w <= 0)
771 || (y + h <= 0)))
770 return false; 772 return false;
771 773
772 result = pixbuf; 774 result = pixbuf;
773 775
774 if ((w > 0 && w != image_width) 776 if ((w != image_width)
775 || (h > 0 && h != image_height)) 777 || (h != image_height))
776 { 778 {
777 result = gdk_pixbuf_scale_simple (pixbuf, 779 result = gdk_pixbuf_scale_simple (pixbuf,
778 w > 0 ? w : image_width, 780 w, h,
779 h > 0 ? h : image_height,
780 GDK_INTERP_BILINEAR); 781 GDK_INTERP_BILINEAR);
781 } 782 }
782 783
783 bool ret = false; 784 bool ret = false;
784 785

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines