feathersui-starling
feathersui-starling copied to clipboard
TextFieldTextRenderer: gutter clipping when inside container with scale < 1
Hello, Josh.
I have an issue with Label. If I place Label inside container with .scale = 0.3 the text inside Label will be cutted. It happens only on iPhone with Retina display. How to fix this issue?
Actual result

Expected result

Code inside StarlingRoot.as
const PADDING:int = 10;
const TEXT_WIDTH:int = 280;
const TEXT_HEIGHT:int = 60;
var container:Sprite = new Sprite();
container.scale = 0.3;
addChild(container);
var labelBG:Quad = new Quad(TEXT_WIDTH, TEXT_HEIGHT, 0xCCCCCC);
labelBG.x = PADDING;
labelBG.y = PADDING;
container.addChild(labelBG);
var label:Label = new Label();
label.width = TEXT_WIDTH;
label.height = TEXT_HEIGHT;
label.x = PADDING;
label.y = PADDING;
label.textRendererFactory = function ():ITextRenderer
{
var textRenderer:TextFieldTextRenderer = new TextFieldTextRenderer();
textRenderer.updateSnapshotOnScaleChange = true;
textRenderer.embedFonts = true;
return textRenderer;
};
label.text = "HELLO";
label.fontStyles = new TextFormat("Arial", 20, 0x000000,Align.LEFT);
container.addChild(label);
How to test the issue with ADL:
adl.exe -profile extendedMobileDevice -screensize 640x1136:640x1136 -XscreenDPI 556 -XversionPlatform IOS game-android.xml bin
I can reproduce this issue. As a workaround, you can enable the TextField's gutter:
textRenderer.useGutter = true;
Thanks, Josh!
Hello, Josh. When do you plan to fix this issue?
I plan to look at it some time in the next month or two for the upcoming Feathers 3.3.
Ok.
I have investigated, and there is no clear way to fix this issue. I suggest simply going with the useGutter = true workaround that I suggested.