… | |
… | |
565 | 100, ASIMAGE_QUALITY_DEFAULT); |
565 | 100, ASIMAGE_QUALITY_DEFAULT); |
566 | } |
566 | } |
567 | |
567 | |
568 | if (background == NULL) |
568 | if (background == NULL) |
569 | { |
569 | { |
570 | /* if tiling - pixmap has to be sized exactly as the image, |
|
|
571 | but there is no need to make it bigger than the window! */ |
|
|
572 | if (h_scale == 0) |
|
|
573 | new_pmap_width = min (result->width, target_width); |
|
|
574 | if (v_scale == 0) |
|
|
575 | new_pmap_height = min (result->height, target_height); |
|
|
576 | /* we also need to tile our image in one or both directions */ |
|
|
577 | if (h_scale == 0 || v_scale == 0) |
570 | if (h_scale == 0 || v_scale == 0) |
578 | { |
571 | { |
|
|
572 | /* if tiling - pixmap has to be sized exactly as the image, |
|
|
573 | but there is no need to make it bigger than the window! */ |
|
|
574 | new_pmap_width = min (result->width, target_width); |
|
|
575 | new_pmap_height = min (result->height, target_height); |
|
|
576 | |
|
|
577 | /* we also need to tile our image in both directions */ |
579 | ASImage *tmp = tile_asimage (target->asv, result, |
578 | ASImage *tmp = tile_asimage (target->asv, result, |
580 | (h_scale > 0) ? 0 : (int)result->width - x, |
579 | (int)result->width - x, |
581 | (v_scale > 0) ? 0 : (int)result->height - y, |
580 | (int)result->height - y, |
582 | new_pmap_width, |
581 | new_pmap_width, |
583 | new_pmap_height, |
582 | new_pmap_height, |
584 | TINT_LEAVE_SAME, ASA_XImage, |
583 | TINT_LEAVE_SAME, ASA_XImage, |
585 | 100, ASIMAGE_QUALITY_DEFAULT); |
584 | 100, ASIMAGE_QUALITY_DEFAULT); |
586 | if (tmp) |
585 | if (tmp) |
… | |
… | |
684 | |
683 | |
685 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
684 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
686 | int dst_width = result->width, dst_height = result->height; |
685 | int dst_width = result->width, dst_height = result->height; |
687 | if (background == NULL) |
686 | if (background == NULL) |
688 | { |
687 | { |
|
|
688 | if (!(h_scale == 0 || v_scale == 0)) |
|
|
689 | { |
689 | if (h_scale > 0) src_x = make_clip_rectangle (x, result->width , new_pmap_width , dst_x, dst_width ); |
690 | src_x = make_clip_rectangle (x, result->width , new_pmap_width , dst_x, dst_width ); |
690 | if (v_scale > 0) src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height); |
691 | src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height); |
|
|
692 | } |
691 | |
693 | |
692 | if (dst_x > 0 || dst_y > 0 |
694 | if (dst_x > 0 || dst_y > 0 |
693 | || dst_x + dst_width < new_pmap_width |
695 | || dst_x + dst_width < new_pmap_width |
694 | || dst_y + dst_height < new_pmap_height) |
696 | || dst_y + dst_height < new_pmap_height) |
695 | XFillRectangle (target->dpy, pixmap, gc, 0, 0, new_pmap_width, new_pmap_height); |
697 | XFillRectangle (target->dpy, pixmap, gc, 0, 0, new_pmap_width, new_pmap_height); |