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.163 by sf-exg, Sat Aug 13 09:05:44 2011 UTC vs.
Revision 1.164 by sf-exg, Sun Aug 14 22:01:25 2011 UTC

218 geom_flags = WidthValue|HeightValue|XValue|YValue; 218 geom_flags = WidthValue|HeightValue|XValue|YValue;
219 } 219 }
220 else if (!strcasecmp (arr[i], "style=aspect-stretched")) 220 else if (!strcasecmp (arr[i], "style=aspect-stretched"))
221 { 221 {
222 new_flags = BG_PROP_SCALE; 222 new_flags = BG_PROP_SCALE;
223 w = h = windowScale;
223 x = y = centerAlign; 224 x = y = centerAlign;
224 geom_flags = XValue|YValue; 225 geom_flags = WidthValue|HeightValue|XValue|YValue;
225 } 226 }
226 else if (!strcasecmp (arr[i], "style=stretched")) 227 else if (!strcasecmp (arr[i], "style=stretched"))
227 { 228 {
228 new_flags = 0; 229 new_flags = 0;
229 w = h = windowScale; 230 w = h = windowScale;
334rxvt_term::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y) 335rxvt_term::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y)
335{ 336{
336 int target_width = szHint.width; 337 int target_width = szHint.width;
337 int target_height = szHint.height; 338 int target_height = szHint.height;
338 339
340 w = h_scale * target_width / 100;
341 h = v_scale * target_height / 100;
342
339 if (bg_flags & BG_PROP_SCALE) 343 if (bg_flags & BG_PROP_SCALE)
340 { 344 {
341 float scale = (float)target_width / image_width; 345 float scale = (float)w / image_width;
342 min_it (scale, (float)target_height / image_height); 346 min_it (scale, (float)h / image_height);
343 w = image_width * scale + 0.5; 347 w = image_width * scale + 0.5;
344 h = image_height * scale + 0.5; 348 h = image_height * scale + 0.5;
345 } 349 }
346 else
347 {
348 w = h_scale * target_width / 100;
349 h = v_scale * target_height / 100;
350 }
351 350
352 if (!w) w = image_width; 351 if (!w) w = image_width;
353 if (!h) h = image_height; 352 if (!h) h = image_height;
354 353
355 if (bg_flags & BG_ROOT_ALIGN) 354 if (bg_flags & BG_ROOT_ALIGN)
363 y = make_align_position (v_align, target_height, h); 362 y = make_align_position (v_align, target_height, h);
364 } 363 }
365 364
366 bg_flags &= ~BG_IS_SIZE_SENSITIVE; 365 bg_flags &= ~BG_IS_SIZE_SENSITIVE;
367 if (!(bg_flags & BG_TILE) 366 if (!(bg_flags & BG_TILE)
368 || (bg_flags & BG_PROP_SCALE) || h_scale || v_scale 367 || h_scale || v_scale
369 || (!(bg_flags & BG_ROOT_ALIGN) && (h_align || v_align)) 368 || (!(bg_flags & BG_ROOT_ALIGN) && (h_align || v_align))
370 || w > target_width || h > target_height) 369 || w > target_width || h > target_height)
371 bg_flags |= BG_IS_SIZE_SENSITIVE; 370 bg_flags |= BG_IS_SIZE_SENSITIVE;
372} 371}
373 372

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines