Closed n3v3rf411 closed 6 years ago
thanks for a great reproducible issue - will look shortly!
Can you attach the dialog back image? Or something of similar size?
Cheers, Ian
Here it is:
The css in the original flash source is as follows. I would like to replicate its behaviour but maybe there is no equivalent for scaleGrid* in haxeui:
.dialogBackGroundSkin{
border-skin:Embed(source="../image/main/dialogBack.png", scaleGridTop='4', scaleGridBottom='602', scaleGridLeft='4', scaleGridRight='969');
disabled-overlay-alpha:0;
}
Ah, are you trying to 9-slice it? ie, the corners stay the same and the sides and middle stretch appropriately?
Yes yes indeed! I want to reuse this image for dialogs of any sizes.
Ok, cool - its certainly possible in haxeui... let me knock up an example real quick.
ok, this should work:
<style>
.dialog-bg {
background-image: "img/bg.png";
background-image-slice: 5px 5px 602px 969px;
padding: 10px;
}
</style>
<vbox width="200" height="200" styleNames="dialog-bg">
<button text="Button" />
<button text="Button" />
<button text="Button" />
<button text="Button" />
<button text="Button" />
<button text="Button" width="100%" height="100%" />
</vbox>
and i get:
Hope that helps!
Ian
Ooo works great! Thanks!
I think we can close this now 😃
Tested with OpenFL backend only. Image component having bitmap dimensions greater than parent component dimensions shows the bitmap in its original dimensions.
Expected Behavior
The image display should scale.
Current Behavior
It does not scale at all.
Possible Cause
haxe.ui.backend.ImageDisplayBase#validateData overwrites _imageWidth and _imageHeight that were set in haxe.ui.components.Image#resizeChildren. Since validateData is called before validateDisplay, which sets the bitmap scale in OpenFL, the value used in determining the scales are always equal to the original image width and height.
Steps to Reproduce (for bugs)
Your Environment