Prevent upscaled SVG from exceeding Image bounds

Also expose Image MAX_WIDTH and MAX_HEIGHT.

Fixes #24455.

(cherry picked from commit cc0842f9a6)
This commit is contained in:
Rémi Verschelde
2019-01-28 15:33:56 +01:00
parent c2541188f2
commit 2ff2b727b6
4 changed files with 18 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
Image datatype.
</brief_description>
<description>
Native image datatype. Contains image data, which can be converted to a [Texture], and several functions to interact with it. The maximum width and height for an [code]Image[/code] is 16384 pixels.
Native image datatype. Contains image data, which can be converted to a [Texture], and several functions to interact with it. The maximum width and height for an [code]Image[/code] are [constant MAX_WIDTH] and [constant MAX_HEIGHT].
</description>
<tutorials>
</tutorials>
@@ -431,6 +431,12 @@
</member>
</members>
<constants>
<constant name="MAX_WIDTH" value="16384">
The maximal width allowed for [code]Image[/code] resources.
</constant>
<constant name="MAX_HEIGHT" value="16384">
The maximal height allowed for [code]Image[/code] resources.
</constant>
<constant name="FORMAT_L8" value="0" enum="Format">
</constant>
<constant name="FORMAT_LA8" value="1" enum="Format">