… | |
… | |
201 | x = y = 0; |
201 | x = y = 0; |
202 | geom_flags = WidthValue|HeightValue|XValue|YValue; |
202 | geom_flags = WidthValue|HeightValue|XValue|YValue; |
203 | } |
203 | } |
204 | else if (!strcasecmp (arr[i], "style=aspect-stretched")) |
204 | else if (!strcasecmp (arr[i], "style=aspect-stretched")) |
205 | { |
205 | { |
206 | new_flags = BG_PROP_SCALE; |
206 | new_flags = BG_KEEP_ASPECT; |
207 | w = h = windowScale; |
207 | w = h = windowScale; |
208 | x = y = centerAlign; |
208 | x = y = centerAlign; |
209 | geom_flags = WidthValue|HeightValue|XValue|YValue; |
209 | geom_flags = WidthValue|HeightValue|XValue|YValue; |
210 | } |
210 | } |
211 | else if (!strcasecmp (arr[i], "style=stretched")) |
211 | else if (!strcasecmp (arr[i], "style=stretched")) |
… | |
… | |
227 | w = h = noScale; |
227 | w = h = noScale; |
228 | geom_flags = WidthValue|HeightValue; |
228 | geom_flags = WidthValue|HeightValue; |
229 | } |
229 | } |
230 | else if (!strcasecmp (arr[i], "op=tile")) |
230 | else if (!strcasecmp (arr[i], "op=tile")) |
231 | new_flags |= BG_TILE; |
231 | new_flags |= BG_TILE; |
232 | else if (!strcasecmp (arr[i], "op=pscale")) |
232 | else if (!strcasecmp (arr[i], "op=keep-aspect")) |
233 | new_flags |= BG_PROP_SCALE; |
233 | new_flags |= BG_KEEP_ASPECT; |
234 | else if (!strcasecmp (arr[i], "op=root")) |
234 | else if (!strcasecmp (arr[i], "op=root-align")) |
235 | new_flags |= BG_ROOT_ALIGN; |
235 | new_flags |= BG_ROOT_ALIGN; |
236 | |
236 | |
237 | // deprecated |
237 | // deprecated |
238 | else if (!strcasecmp (arr[i], "tile")) |
238 | else if (!strcasecmp (arr[i], "tile")) |
239 | { |
239 | { |
… | |
… | |
241 | w = h = noScale; |
241 | w = h = noScale; |
242 | geom_flags |= WidthValue|HeightValue; |
242 | geom_flags |= WidthValue|HeightValue; |
243 | } |
243 | } |
244 | else if (!strcasecmp (arr[i], "propscale")) |
244 | else if (!strcasecmp (arr[i], "propscale")) |
245 | { |
245 | { |
246 | new_flags |= BG_PROP_SCALE; |
246 | new_flags |= BG_KEEP_ASPECT; |
247 | } |
247 | } |
248 | else if (!strcasecmp (arr[i], "hscale")) |
248 | else if (!strcasecmp (arr[i], "hscale")) |
249 | { |
249 | { |
250 | new_flags |= BG_TILE; |
250 | new_flags |= BG_TILE; |
251 | w = windowScale; |
251 | w = windowScale; |
… | |
… | |
322 | int target_height = szHint.height; |
322 | int target_height = szHint.height; |
323 | |
323 | |
324 | w = h_scale * target_width / 100; |
324 | w = h_scale * target_width / 100; |
325 | h = v_scale * target_height / 100; |
325 | h = v_scale * target_height / 100; |
326 | |
326 | |
327 | if (bg_flags & BG_PROP_SCALE) |
327 | if (bg_flags & BG_KEEP_ASPECT) |
328 | { |
328 | { |
329 | float scale = (float)w / image_width; |
329 | float scale = (float)w / image_width; |
330 | min_it (scale, (float)h / image_height); |
330 | min_it (scale, (float)h / image_height); |
331 | w = image_width * scale + 0.5; |
331 | w = image_width * scale + 0.5; |
332 | h = image_height * scale + 0.5; |
332 | h = image_height * scale + 0.5; |