… | |
… | |
157 | # endif |
157 | # endif |
158 | |
158 | |
159 | # ifdef BG_IMAGE_FROM_FILE |
159 | # ifdef BG_IMAGE_FROM_FILE |
160 | if (have_image) |
160 | if (have_image) |
161 | { |
161 | { |
162 | if (h_align == rootAlign || v_align == rootAlign) |
162 | if (flags & rootAlign) |
163 | return true; |
163 | return true; |
164 | } |
164 | } |
165 | # endif |
165 | # endif |
166 | |
166 | |
167 | return false; |
167 | return false; |
… | |
… | |
207 | static inline bool |
207 | static inline bool |
208 | check_set_align_value (int geom_flags, int flag, int &align, int new_value) |
208 | check_set_align_value (int geom_flags, int flag, int &align, int new_value) |
209 | { |
209 | { |
210 | if (geom_flags & flag) |
210 | if (geom_flags & flag) |
211 | { |
211 | { |
212 | if (new_value != bgPixmap_t::rootAlign) |
|
|
213 | { |
|
|
214 | if (new_value < -100) |
212 | if (new_value < -100) |
215 | new_value = -100; |
213 | new_value = -100; |
216 | else if (new_value > 200) |
214 | else if (new_value > 200) |
217 | new_value = 200; |
215 | new_value = 200; |
218 | } |
|
|
219 | if (new_value != align) |
216 | if (new_value != align) |
220 | { |
217 | { |
221 | align = new_value; |
218 | align = new_value; |
222 | return true; |
219 | return true; |
223 | } |
220 | } |
… | |
… | |
418 | x = y = centerAlign; |
415 | x = y = centerAlign; |
419 | geom_flags |= WidthValue|HeightValue|XValue|YValue; |
416 | geom_flags |= WidthValue|HeightValue|XValue|YValue; |
420 | } |
417 | } |
421 | else if (CHECK_GEOM_OPS ("root")) |
418 | else if (CHECK_GEOM_OPS ("root")) |
422 | { |
419 | { |
|
|
420 | new_flags |= rootAlign; |
423 | w = h = noScale; |
421 | w = h = noScale; |
424 | x = y = rootAlign; |
|
|
425 | geom_flags |= WidthValue|HeightValue|XValue|YValue; |
422 | geom_flags |= WidthValue|HeightValue; |
426 | } |
423 | } |
427 | # undef CHECK_GEOM_OPS |
424 | # undef CHECK_GEOM_OPS |
428 | |
425 | |
429 | while (*ops != ':' && *ops != '\0') ++ops; |
426 | while (*ops != ':' && *ops != '\0') ++ops; |
430 | } /* done parsing ops */ |
427 | } /* done parsing ops */ |
… | |
… | |
464 | { |
461 | { |
465 | w = h_scale * target_width / 100; |
462 | w = h_scale * target_width / 100; |
466 | h = v_scale * target_height / 100; |
463 | h = v_scale * target_height / 100; |
467 | } |
464 | } |
468 | |
465 | |
469 | if (h_align == rootAlign || v_align == rootAlign) |
466 | if (flags & rootAlign) |
470 | { |
467 | { |
471 | target->get_window_origin (x, y); |
468 | target->get_window_origin (x, y); |
472 | x = -x; |
469 | x = -x; |
473 | y = -y; |
470 | y = -y; |
474 | } |
471 | } |
475 | |
472 | else |
476 | if (h_align != rootAlign) |
473 | { |
477 | x = make_align_position (h_align, target_width, w > 0 ? w : image_width); |
474 | x = make_align_position (h_align, target_width, w > 0 ? w : image_width); |
478 | |
|
|
479 | if (v_align != rootAlign) |
|
|
480 | y = make_align_position (v_align, target_height, h > 0 ? h : image_height); |
475 | y = make_align_position (v_align, target_height, h > 0 ? h : image_height); |
|
|
476 | } |
481 | |
477 | |
482 | flags &= ~sizeSensitive; |
478 | flags &= ~sizeSensitive; |
483 | if (h_scale != 0 || v_scale != 0 |
479 | if (h_scale != 0 || v_scale != 0 |
484 | || h_align != 0 || v_align != 0 |
480 | || h_align != 0 || v_align != 0 |
485 | || image_width > target_width || image_height > target_height) |
481 | || image_width > target_width || image_height > target_height) |