feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
915 stars 386 forks source link

TextInput inside container with scale < 0 crops text #1758

Closed subdan closed 6 years ago

subdan commented 6 years ago

Hello, Josh.

I have a Screen with .scale < 1. Inside the Screen I have a TextInput with scale = 1. After I type some text in to the TextInput and tap outside the TextInput text became cropped. As a workaround I set: textInput.scale = 1 / this.scale.

Is it a bug? How to fix it?

symbol 1

  1. TextInput.scale = 1/ this.scale
  2. TextInput.scale = 1
joshtynjala commented 6 years ago

Which ITextRenderer implementation are you using?

subdan commented 6 years ago

TextFieldTextRenderer

joshtynjala commented 6 years ago

As a workaround, you could set the useGutter property to true.

Actually, this is the same advice that I gave you in #1545.

subdan commented 6 years ago

Ok. Thanks.

subdan commented 6 years ago

I set useGutter=true and it did not helps.

subdan commented 6 years ago

The issue happens only on Android device.

joshtynjala commented 6 years ago

Does it look exactly the same when you set useGutter to true? You should see a couple more pixels of the text, even if there's still a bit cut off. If not, then it may actually be a rendering issue caused by the texture appearing on a non-integer pixel. Text tends to distort and blur unless it is positioned perfectly, and setting the scale of a parent container to a value other than 1 can affect the ability to snap to the nearest pixel.

I recommend changing the scale of containers that have text only during animations, when it will be difficult to see these sorts of issues.

subdan commented 6 years ago

Yes, it look exactly the same. screenshot_2018-08-25-17-55-20

subdan commented 6 years ago

I'm developing an Android app. I created GUI for 10" display. To display GUI on 7" display I scale down instances of Screen and PanelScreen. To calculate scale I use this code:

        var screenDiagonalInches:Number = Math.sqrt(
                Math.pow(DeviceCapabilities.screenInchesX(Starling.current.nativeStage), 2) +
                Math.pow(DeviceCapabilities.screenInchesY(Starling.current.nativeStage), 2));
        if (screenDiagonalInches < 10)
            return screenDiagonalInches / 10;
        else
            return 1;