This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch fix/super-signature-checks in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit f2f233378a3325de91eac04f6b1d04ab0c889b8b Author: Josh Tynjala <[email protected]> AuthorDate: Wed Oct 9 13:26:23 2024 -0700 MXRoyale: fix BitmapAsset constructor first parameter type super() constructor accepts BitmapData on SWF and Object on JS. Parameter was incorrectly typed as Bitmap, which isn't correct for either one. Now has separate constructors for SWF and JS that accept the correct types. BitmapAsset in Flex is related to [Embed] metadata, so I suspect that this class may not even be used in Royale normally. --- .../src/main/royale/mx/core/BitmapAsset.as | 40 +++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/BitmapAsset.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/BitmapAsset.as index 7d7e30ef10..55c8c44aaf 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/BitmapAsset.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/BitmapAsset.as @@ -24,6 +24,10 @@ import org.apache.royale.events.Event; import org.apache.royale.geom.Point; import mx.system.ApplicationDomain; import mx.display.Bitmap; +COMPILE::SWF +{ + import flash.display.BitmapData; +} /** * BitmapAsset is a subclass of the flash.display.Bitmap class @@ -116,6 +120,40 @@ public class BitmapAsset extends Bitmap //extends FlexBitmap // //-------------------------------------------------------------------------- + COMPILE::SWF + /** + * Constructor. + * + * @param bitmapData The data for the bitmap image. + * + * @param pixelSnapping Whether or not the bitmap is snapped + * to the nearest pixel. + * + * @param smoothing Whether or not the bitmap is smoothed when scaled. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function BitmapAsset(bitmapData:BitmapData = null, + pixelSnapping:String = "auto", + smoothing:Boolean = false) + { + super(bitmapData, pixelSnapping, smoothing); + + /* if (FlexVersionClass == null) + { + var appDomain:ApplicationDomain = ApplicationDomain.currentDomain; + if (appDomain.hasDefinition("mx.core::FlexVersion")) + FlexVersionClass = Class(appDomain.getDefinition("mx.core::FlexVersion")); + } + + if (FlexVersionClass && FlexVersionClass["compatibilityVersion"] >= FlexVersionClass["VERSION_4_0"]) + //this.addEventListener(Event.ADDED, addedHandler); */ + } + + COMPILE::JS /** * Constructor. * @@ -131,7 +169,7 @@ public class BitmapAsset extends Bitmap //extends FlexBitmap * @playerversion AIR 1.1 * @productversion Flex 3 */ - public function BitmapAsset(bitmapData:Bitmap = null, + public function BitmapAsset(bitmapData:Object = null, pixelSnapping:String = "auto", smoothing:Boolean = false) {
