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.61 by sf-exg, Sun Oct 3 20:48:34 2010 UTC vs.
Revision 1.62 by sf-exg, Sun Oct 3 21:44:13 2010 UTC

387 w = h = noScale; 387 w = h = noScale;
388 geom_flags |= WidthValue|HeightValue; 388 geom_flags |= WidthValue|HeightValue;
389 } 389 }
390 else if (CHECK_GEOM_OPS ("propscale")) 390 else if (CHECK_GEOM_OPS ("propscale"))
391 { 391 {
392 if (w == 0 && h == 0)
393 {
394 w = windowScale;
395 geom_flags |= WidthValue;
396 }
397 new_flags |= propScale; 392 new_flags |= propScale;
398 } 393 }
399 else if (CHECK_GEOM_OPS ("hscale")) 394 else if (CHECK_GEOM_OPS ("hscale"))
400 { 395 {
401 if (w == 0) w = windowScale; 396 if (w == 0) w = windowScale;
456bgPixmap_t::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y) 451bgPixmap_t::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y)
457{ 452{
458 int target_width = target->szHint.width; 453 int target_width = target->szHint.width;
459 int target_height = target->szHint.height; 454 int target_height = target->szHint.height;
460 455
456 if (flags & propScale)
457 {
458 float scale = (float)target_width / image_width;
459 min_it (scale, (float)target_height / image_height);
460 w = image_width * scale + 0.5;
461 h = image_height * scale + 0.5;
462 }
463 else
464 {
461 w = h_scale * target_width / 100; 465 w = h_scale * target_width / 100;
462 h = v_scale * target_height / 100; 466 h = v_scale * target_height / 100;
467 }
463 468
464 if (h_align == rootAlign || v_align == rootAlign) 469 if (h_align == rootAlign || v_align == rootAlign)
465 { 470 {
466 target->get_window_origin (x, y); 471 target->get_window_origin (x, y);
467 x = -x; 472 x = -x;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines