You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pu...@apache.org on 2021/09/19 21:40:06 UTC

[royale-asjs] branch develop updated: Added textHeight and textWidth in Label.as

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 071c7e4  Added textHeight and textWidth in Label.as
071c7e4 is described below

commit 071c7e406f30cbeda5fcc87bd5393a6bf75809bc
Author: pashminakazi <pa...@gmail.com>
AuthorDate: Sun Sep 19 14:39:55 2021 -0700

    Added textHeight and textWidth in Label.as
---
 .../MXRoyale/src/main/royale/mx/controls/Label.as  | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as
index 8e24b2e..56ea0b1 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as
@@ -824,6 +824,74 @@ public class Label extends UIComponent
      *  @productversion Flex 3
      */
     protected var textField:IUITextField;
+	
+	//----------------------------------
+    //  textHeight
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the textHeight property.
+     */
+    private var _textHeight:Number;
+
+    /**
+     *  The height of the text.
+     *
+     *  <p>The value of the <code>textHeight</code> property is correct only
+     *  after the component has been validated.
+     *  If you set <code>text</code> and then immediately ask for the
+     *  <code>textHeight</code>, you might receive an incorrect value.
+     *  You should wait for the component to validate
+     *  or call the <code>validateNow()</code> method before you get the value.
+     *  This behavior differs from that of the flash.text.TextField control,
+     *  which updates the value immediately.</p>
+     *
+     *  @see flash.text.TextField
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get textHeight():Number
+    {
+        return _textHeight;
+    }
+
+    //----------------------------------
+    //  textWidth
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the textWidth property.
+     */
+    private var _textWidth:Number;
+
+    /**
+     *  The width of the text.
+     *
+     *  <p>The value of the <code>textWidth</code> property is correct only
+     *  after the component has been validated.
+     *  If you set <code>text</code> and then immediately ask for the
+     *  <code>textWidth</code>, you might receive an incorrect value.
+     *  You should wait for the component to validate
+     *  or call the <code>validateNow()</code> method before you get the value.
+     *  This behavior differs from that of the flash.text.TextField control,
+     *  which updates the value immediately.</p>
+     *
+     *  @see flash.text.TextField
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get textWidth():Number
+    {
+        return _textWidth;
+    }