mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 19:19:29 +00:00

Prior to this commit, the scaled= attribute was undocumented and had what I assume was a bug - when enabled the image was scaled up to the width and height of the background - not to the same ratio as the background, but to the full size. So if you had a 1000 pixel wide background in an 800 pixel wide window, then scaled=yes meant each journey-marker was an 800 pixel-wide blob. However, if anyone was using it with background-size images as overlays then this commit will break that usage - that use case is still supported by having multiple [background_layer]s. Closes #5223, which was a question about whether to fix or simply remove the scaled attribute. Given that [background_layer]scale= and [image]scaled= have different meanings (the background_layer one should and does cause it to be full-window), I've kept the 'd' on the end of 'scaled' too. Use a loop instead of recursion. This cleanup is prompted by #5041 (drawing map labels in IntroWML), which will add more items to be drawn in this loop. The old implementation would not have triggered tail-recursion optimisations, as the recursion site wasn't the final code in the function. Correct documentation in the .hpp file about when the delay takes effect (this isn't a behavior change, just a documentation correction). Review the schema, and remove attributes that aren't supported by the code. Many of these attributes are supported for `background_layer` but not `image`.