… | |
… | |
616 | layers[0].clip_width = target_width; |
616 | layers[0].clip_width = target_width; |
617 | layers[0].clip_height = target_height; |
617 | layers[0].clip_height = target_height; |
618 | layers[0].tint = background_tint; |
618 | layers[0].tint = background_tint; |
619 | layers[1].im = result; |
619 | layers[1].im = result; |
620 | |
620 | |
621 | if (w <= 0) |
621 | if (h_scale == 0 || v_scale == 0) |
622 | { |
622 | { |
623 | /* tile horizontally */ |
623 | /* tile horizontally */ |
624 | while (x > 0) x -= (int)result->width; |
624 | while (x > 0) x -= (int)result->width; |
625 | layers[1].dst_x = x; |
625 | layers[1].dst_x = x; |
626 | layers[1].clip_width = result->width+target_width; |
626 | layers[1].clip_width = result->width+target_width; |
… | |
… | |
630 | /* clip horizontally */ |
630 | /* clip horizontally */ |
631 | layers[1].dst_x = x; |
631 | layers[1].dst_x = x; |
632 | layers[1].clip_width = result->width; |
632 | layers[1].clip_width = result->width; |
633 | } |
633 | } |
634 | |
634 | |
635 | if (h <= 0) |
635 | if (h_scale == 0 || v_scale == 0) |
636 | { |
636 | { |
637 | while (y > 0) y -= (int)result->height; |
637 | while (y > 0) y -= (int)result->height; |
638 | layers[1].dst_y = y; |
638 | layers[1].dst_y = y; |
639 | layers[1].clip_height = result->height + target_height; |
639 | layers[1].clip_height = result->height + target_height; |
640 | } |
640 | } |