You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2021/12/15 00:59:03 UTC

[royale-asjs] 01/03: This was done in TextInput, but not in TextArea. The default size now matches Flex.

This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit f5eda276ea2381d3407d2fa591587c5ba2861c70
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Dec 15 12:44:27 2021 +1300

    This was done in TextInput, but not in TextArea. The default size now matches Flex.
---
 .../src/main/royale/mx/controls/TextArea.as        | 25 ++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
index c4c3636..9c04e5f 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
@@ -2074,6 +2074,22 @@ public class TextArea extends ScrollControlBase
 //            verticalScrollPosition = _vScrollPosition;
     }
 
+    override public function getExplicitOrMeasuredWidth():Number
+    {
+        if (!isNaN(explicitWidth))
+            return explicitWidth;
+        measure()
+        return measuredWidth;
+    }
+
+    override public function getExplicitOrMeasuredHeight():Number
+    {
+        if (!isNaN(explicitHeight))
+            return explicitHeight;
+        measure()
+        return measuredHeight;
+    }
+
     /**
      *  @private
      */
@@ -2081,10 +2097,11 @@ public class TextArea extends ScrollControlBase
     {
         super.measure();
 
-//        measuredMinWidth = DEFAULT_MEASURED_MIN_WIDTH;
-//        measuredWidth = DEFAULT_MEASURED_WIDTH;
-//        // TextArea is minimum of two lines of text
-//        measuredMinHeight = measuredHeight = 2 * DEFAULT_MEASURED_MIN_HEIGHT;
+        measuredMinWidth = DEFAULT_MEASURED_MIN_WIDTH;
+        measuredWidth = DEFAULT_MEASURED_WIDTH;
+        // TextArea is minimum of two lines of text
+        measuredMinHeight = measuredHeight = 2 * DEFAULT_MEASURED_MIN_HEIGHT;
+
     }
 
     /**