[NUI] apply scaling factor to point size (#3594)
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Fri, 17 Sep 2021 08:49:27 +0000 (01:49 -0700)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Fri, 17 Sep 2021 13:10:44 +0000 (06:10 -0700)
src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs

index e400fe5..2ded6c4 100755 (executable)
@@ -101,6 +101,10 @@ namespace Tizen.NUI.BaseComponents
             var textEditor = (TextEditor)bindable;
             if (newValue != null)
             {
+                if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+                {
+                    newValue = (float)newValue * GraphicsTypeManager.Instance.ScalingFactor;
+                }
                 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.PointSize, new Tizen.NUI.PropertyValue((float)newValue));
             }
         }),
@@ -109,6 +113,10 @@ namespace Tizen.NUI.BaseComponents
             var textEditor = (TextEditor)bindable;
             float temp = 0.0f;
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.PointSize).Get(out temp);
+            if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+            {
+                temp = (float)temp / GraphicsTypeManager.Instance.ScalingFactor;
+            }
             return temp;
         }));
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
@@ -513,6 +521,10 @@ namespace Tizen.NUI.BaseComponents
             var textEditor = (TextEditor)bindable;
             if (newValue != null)
             {
+                if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+                {
+                    newValue = (float)newValue * GraphicsTypeManager.Instance.ScalingFactor;
+                }
                 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.InputPointSize, new Tizen.NUI.PropertyValue((float)newValue));
             }
         }),
@@ -521,6 +533,10 @@ namespace Tizen.NUI.BaseComponents
             var textEditor = (TextEditor)bindable;
             float temp = 0.0f;
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.InputPointSize).Get(out temp);
+            if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+            {
+                temp = (float)temp / GraphicsTypeManager.Instance.ScalingFactor;
+            }
             return temp;
         }));
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
index 8d7cef6..9ba8fd2 100755 (executable)
@@ -169,6 +169,10 @@ namespace Tizen.NUI.BaseComponents
             var textField = (TextField)bindable;
             if (newValue != null)
             {
+                if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+                {
+                    newValue = (float)newValue * GraphicsTypeManager.Instance.ScalingFactor;
+                }
                 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.PointSize, new Tizen.NUI.PropertyValue((float)newValue));
             }
         }),
@@ -177,6 +181,10 @@ namespace Tizen.NUI.BaseComponents
             var textField = (TextField)bindable;
             float temp = 0.0f;
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.PointSize).Get(out temp);
+            if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+            {
+                temp = (float)temp / GraphicsTypeManager.Instance.ScalingFactor;
+            }
             return temp;
         }));
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
@@ -721,6 +729,10 @@ namespace Tizen.NUI.BaseComponents
             var textField = (TextField)bindable;
             if (newValue != null)
             {
+                if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+                {
+                    newValue = (float)newValue * GraphicsTypeManager.Instance.ScalingFactor;
+                }
                 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.InputPointSize, new Tizen.NUI.PropertyValue((float)newValue));
             }
         }),
@@ -729,6 +741,10 @@ namespace Tizen.NUI.BaseComponents
             var textField = (TextField)bindable;
             float temp = 0.0f;
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.InputPointSize).Get(out temp);
+            if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+            {
+                temp = (float)temp / GraphicsTypeManager.Instance.ScalingFactor;
+            }
             return temp;
         }));
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
index 433469b..511f3cf 100755 (executable)
@@ -136,6 +136,10 @@ namespace Tizen.NUI.BaseComponents
             var textLabel = (TextLabel)bindable;
             float temp = 0.0f;
             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.PointSize).Get(out temp);
+            if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+            {
+                temp = (float)temp / GraphicsTypeManager.Instance.ScalingFactor;
+            }
             return temp;
         }));
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
@@ -769,6 +773,10 @@ namespace Tizen.NUI.BaseComponents
         {
             if (value != null)
             {
+                if (GraphicsTypeManager.Instance.ScalingFactor != 0.0f)
+                {
+                    value = value * GraphicsTypeManager.Instance.ScalingFactor;
+                }
                 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, TextLabel.Property.PointSize, new Tizen.NUI.PropertyValue((float)value));
                 RequestLayout();
             }