When scaling the Spark Image
component, the bounding box does not scale with it. This means the parent container (in this case, a Group
) does not fit the image bounds exactly. I've seen this asked several times, but never have I seen someone give an answer.
Code currently being used:
this.headerArea = new Group();
this.headerArea.percentWidth = 100;
this.headerArea.styleName = "pageHead";
this.scrollViewport.addElementAt( this.headerArea, 0 );
this.logo = new Image();
this.logo.source = "assets/images/logo.png";
this.logo.scaleMode = BitmapScaleMode.LETTERBOX;
this.logo.smooth = true;
this.logo.percentWidth = 75;
this.logo.horizontalCenter = 0;
this.logo.styleName = "headerLogo";
this.headerArea.addElement( this.logo );
The logo scales to the size I need it to, but there is a large amount of padding on top and bottom (which increases as the image's percentWidth
decreases).
Is there any solution to this?