Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-22304

Scaling errors in UIFTETextField and UITextField

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • None
    • Spark: FTETextField
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Run the app below
      2. Click on the checkbox. This will apply a scaleX factor of 2 to all of the objects (the two buttons, the two text fields, and the rect)
      3. Clicking on the checkbox again will toggle the scaleX back to 1

      Actual Results:
      The buttons and rect scale correctly. But there are several problems with the text items:
      1) the first text item appears to scale correctly, but it reports the wrong width/height in the labels in the upper left. Note that the Canvas that parents it is not resized to fit its new width, however (not sure if this is a bug or not)
      2) the second text item appears to not scale at all ... but it reports the correct (scaled) width/height info
      3) If you un-comment the code in creationComplete() that applies the scaleX values upon creation, you'll see that neither text field ever appear, even when toggling the scale checkbox.

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/halo"
      creationComplete="creationComplete()">
      <fx:Script>
      <![CDATA[
      import mx.core.UIFTETextField;
      import mx.core.UITextField;
      private var fteTextField:UIFTETextField;
      private var textField:UITextField;
      private function creationComplete():void

      { fteTextField = new UIFTETextField(); fteTextField.text = "UIFTETextField"; //fteTextField.scaleX = 1.5; canvas.addChild(fteTextField); textField = new UITextField(); textField.text = "UITextField"; //textField.scaleX = 1.5; canvas1.addChild(textField); }

      private function scaleChanged():void

      { textField.text = textField.text; fteTextField.scaleX = (scaleCB.selected) ? 2 : 1; textField.scaleX = (scaleCB.selected) ? 2 : 1; button.scaleX = (scaleCB.selected) ? 2 : 1; rect.scaleX = (scaleCB.selected) ? 2 : 1; button1.scaleX = (scaleCB.selected) ? 2 : 1; fteTextWidthLabel.text = "FTETextField MeasuredWidth: " + String(fteTextField.measuredWidth); fteTextHeightLabel.text = "FTETextField MeasuredHeight: " + String(fteTextField.measuredHeight); textWidthLabel.text = "UITextField MeasuredWidth: " + String(textField.measuredWidth); textHeightLabel.text = "UITextField MeasuredHeight: " + String(textField.measuredHeight); }

      ]]
      >
      </fx:Script>
      <s:CheckBox id="scaleCB" label="Scale objects"
      change="scaleChanged()"/>
      <s:Label y="20" id="fteTextWidthLabel"/>
      <s:Label y="40" id="fteTextHeightLabel"/>
      <s:Label y="60" id="textWidthLabel"/>
      <s:Label y="80" id="textHeightLabel"/>
      <s:HGroup x="100" y="100">
      <s:Button id="button"/>
      <mx:Canvas id="canvas" horizontalScrollPolicy="off"/>
      <mx:Canvas id="canvas1" horizontalScrollPolicy="off"/>
      <s:Rect id="rect" width="50" height="20">
      <s:fill>
      <s:SolidColor color="red"/>
      </s:fill>
      </s:Rect>
      <s:Button id="button1"/>
      </s:HGroup>
      </s:Application>

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment