… | |
… | |
260 | |
260 | |
261 | for (int i = 0; arr[i]; i++) |
261 | for (int i = 0; arr[i]; i++) |
262 | { |
262 | { |
263 | if (!strcasecmp (arr[i], "tile")) |
263 | if (!strcasecmp (arr[i], "tile")) |
264 | { |
264 | { |
|
|
265 | new_flags |= BG_TILE; |
265 | w = h = noScale; |
266 | w = h = noScale; |
266 | geom_flags |= WidthValue|HeightValue; |
267 | geom_flags |= WidthValue|HeightValue; |
267 | } |
268 | } |
268 | else if (!strcasecmp (arr[i], "propscale")) |
269 | else if (!strcasecmp (arr[i], "propscale")) |
269 | { |
270 | { |
… | |
… | |
296 | x = y = centerAlign; |
297 | x = y = centerAlign; |
297 | geom_flags |= WidthValue|HeightValue|XValue|YValue; |
298 | geom_flags |= WidthValue|HeightValue|XValue|YValue; |
298 | } |
299 | } |
299 | else if (!strcasecmp (arr[i], "root")) |
300 | else if (!strcasecmp (arr[i], "root")) |
300 | { |
301 | { |
301 | new_flags |= BG_ROOT_ALIGN; |
302 | new_flags |= BG_TILE|BG_ROOT_ALIGN; |
302 | w = h = noScale; |
303 | w = h = noScale; |
303 | geom_flags |= WidthValue|HeightValue; |
304 | geom_flags |= WidthValue|HeightValue; |
304 | } |
305 | } |
305 | } /* done parsing ops */ |
306 | } /* done parsing ops */ |
306 | |
307 | |
… | |
… | |
353 | x = make_align_position (h_align, target_width, w); |
354 | x = make_align_position (h_align, target_width, w); |
354 | y = make_align_position (v_align, target_height, h); |
355 | y = make_align_position (v_align, target_height, h); |
355 | } |
356 | } |
356 | |
357 | |
357 | bg_flags &= ~BG_IS_SIZE_SENSITIVE; |
358 | bg_flags &= ~BG_IS_SIZE_SENSITIVE; |
|
|
359 | if (!(bg_flags & BG_TILE) |
358 | if ((bg_flags & BG_PROP_SCALE) || h_scale || v_scale |
360 | || (bg_flags & BG_PROP_SCALE) || h_scale || v_scale |
359 | || (!(bg_flags & BG_ROOT_ALIGN) && (h_align || v_align)) |
361 | || (!(bg_flags & BG_ROOT_ALIGN) && (h_align || v_align)) |
360 | || w > target_width || h > target_height) |
362 | || w > target_width || h > target_height) |
361 | bg_flags |= BG_IS_SIZE_SENSITIVE; |
363 | bg_flags |= BG_IS_SIZE_SENSITIVE; |
362 | } |
364 | } |
363 | |
365 | |
… | |
… | |
455 | 100, ASIMAGE_QUALITY_DEFAULT); |
457 | 100, ASIMAGE_QUALITY_DEFAULT); |
456 | } |
458 | } |
457 | |
459 | |
458 | if (background == NULL) |
460 | if (background == NULL) |
459 | { |
461 | { |
460 | if (h_scale == 0 || v_scale == 0) |
462 | if (bg_flags & BG_TILE) |
461 | { |
463 | { |
462 | /* if tiling - pixmap has to be sized exactly as the image, |
464 | /* if tiling - pixmap has to be sized exactly as the image, |
463 | but there is no need to make it bigger than the window! */ |
465 | but there is no need to make it bigger than the window! */ |
464 | new_pmap_width = min (result->width, target_width); |
466 | new_pmap_width = min (result->width, target_width); |
465 | new_pmap_height = min (result->height, target_height); |
467 | new_pmap_height = min (result->height, target_height); |
… | |
… | |
490 | layers[0].clip_width = target_width; |
492 | layers[0].clip_width = target_width; |
491 | layers[0].clip_height = target_height; |
493 | layers[0].clip_height = target_height; |
492 | layers[0].tint = background_tint; |
494 | layers[0].tint = background_tint; |
493 | layers[1].im = result; |
495 | layers[1].im = result; |
494 | |
496 | |
495 | if (h_scale == 0 || v_scale == 0) |
497 | if (bg_flags & BG_TILE) |
496 | { |
498 | { |
497 | /* tile horizontally */ |
499 | /* tile horizontally */ |
498 | while (x > 0) x -= (int)result->width; |
500 | while (x > 0) x -= (int)result->width; |
499 | layers[1].dst_x = x; |
501 | layers[1].dst_x = x; |
500 | layers[1].clip_width = result->width+target_width; |
502 | layers[1].clip_width = result->width+target_width; |
… | |
… | |
504 | /* clip horizontally */ |
506 | /* clip horizontally */ |
505 | layers[1].dst_x = x; |
507 | layers[1].dst_x = x; |
506 | layers[1].clip_width = result->width; |
508 | layers[1].clip_width = result->width; |
507 | } |
509 | } |
508 | |
510 | |
509 | if (h_scale == 0 || v_scale == 0) |
511 | if (bg_flags & BG_TILE) |
510 | { |
512 | { |
511 | while (y > 0) y -= (int)result->height; |
513 | while (y > 0) y -= (int)result->height; |
512 | layers[1].dst_y = y; |
514 | layers[1].dst_y = y; |
513 | layers[1].clip_height = result->height + target_height; |
515 | layers[1].clip_height = result->height + target_height; |
514 | } |
516 | } |
… | |
… | |
564 | |
566 | |
565 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
567 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
566 | int dst_width = result->width, dst_height = result->height; |
568 | int dst_width = result->width, dst_height = result->height; |
567 | if (background == NULL) |
569 | if (background == NULL) |
568 | { |
570 | { |
569 | if (!(h_scale == 0 || v_scale == 0)) |
571 | if (!(bg_flags & BG_TILE)) |
570 | { |
572 | { |
571 | src_x = make_clip_rectangle (x, result->width , new_pmap_width , dst_x, dst_width ); |
573 | src_x = make_clip_rectangle (x, result->width , new_pmap_width , dst_x, dst_width ); |
572 | src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height); |
574 | src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height); |
573 | } |
575 | } |
574 | |
576 | |
… | |
… | |
742 | root_pmap = bg_pixmap; |
744 | root_pmap = bg_pixmap; |
743 | bg_pixmap = None; |
745 | bg_pixmap = None; |
744 | } |
746 | } |
745 | else |
747 | else |
746 | { |
748 | { |
747 | if (h_scale == 0 || v_scale == 0) |
749 | if (bg_flags & BG_TILE) |
748 | { |
750 | { |
749 | new_pmap_width = min (image_width, target_width); |
751 | new_pmap_width = min (image_width, target_width); |
750 | new_pmap_height = min (image_height, target_height); |
752 | new_pmap_height = min (image_height, target_height); |
751 | } |
753 | } |
752 | } |
754 | } |
… | |
… | |
765 | gcv.foreground = pix_colors[Color_bg]; |
767 | gcv.foreground = pix_colors[Color_bg]; |
766 | gc = XCreateGC (dpy, vt, GCForeground, &gcv); |
768 | gc = XCreateGC (dpy, vt, GCForeground, &gcv); |
767 | |
769 | |
768 | if (gc) |
770 | if (gc) |
769 | { |
771 | { |
770 | if (h_scale == 0 || v_scale == 0) |
772 | if (bg_flags & BG_TILE) |
771 | { |
773 | { |
772 | Pixmap tile = XCreatePixmap (dpy, vt, image_width, image_height, depth); |
774 | Pixmap tile = XCreatePixmap (dpy, vt, image_width, image_height, depth); |
773 | pixbuf_to_pixmap (result, tile, gc, |
775 | pixbuf_to_pixmap (result, tile, gc, |
774 | 0, 0, |
776 | 0, 0, |
775 | 0, 0, |
777 | 0, 0, |