--- rxvt-unicode/src/background.C 2010/09/08 22:17:06 1.59 +++ rxvt-unicode/src/background.C 2010/10/03 20:48:34 1.61 @@ -140,8 +140,7 @@ # ifdef BG_IMAGE_FROM_FILE if (have_image) { - if (h_scale != 0 || v_scale != 0 - || h_align != 0 || v_align != 0) + if (flags & sizeSensitive) return true; } # endif @@ -249,7 +248,7 @@ int src_pos = 0; dst_pos = 0; dst_size = size; - if (pos < 0 && size > target_size) + if (pos < 0) { src_pos = -pos; dst_size += pos; @@ -474,6 +473,12 @@ if (v_align != rootAlign) y = make_align_position (v_align, target_height, h > 0 ? h : image_height); + + flags &= ~sizeSensitive; + if (h_scale != 0 || v_scale != 0 + || h_align != 0 || v_align != 0 + || image_width > target_width || image_height > target_height) + flags |= sizeSensitive; } # ifdef HAVE_AFTERIMAGE