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


The following commit(s) were added to refs/heads/develop by this push:
     new 9e722530f9 Some Tuning in SimpleTextHighlighter: for font inheritance 
and 2px padding.
9e722530f9 is described below

commit 9e722530f9632904584709e5cde5916b2d0ef0c0
Author: greg-dove <[email protected]>
AuthorDate: Fri Sep 2 11:00:50 2022 +1200

    Some Tuning in SimpleTextHighlighter: for font inheritance and 2px padding.
---
 frameworks/projects/Basic/src/main/resources/defaults.css              | 1 +
 .../src/main/royale/org/apache/royale/html/SimpleTextHighlighter.as    | 1 +
 .../royale/org/apache/royale/html/supportClasses/HighlightTextSpan.as  | 3 ++-
 .../MXRoyale/src/main/royale/mx/controls/SimpleTextHighlighter.as      | 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Basic/src/main/resources/defaults.css 
b/frameworks/projects/Basic/src/main/resources/defaults.css
index 260aa56397..75df967209 100644
--- a/frameworks/projects/Basic/src/main/resources/defaults.css
+++ b/frameworks/projects/Basic/src/main/resources/defaults.css
@@ -834,6 +834,7 @@ global
        border: 1px #808080 solid;
        white-space: pre-wrap;
        overflow-y: auto;
+       padding: 2px;
 }
 
 .SimpleTextHighlighter *:focus-visible {
diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/SimpleTextHighlighter.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/SimpleTextHighlighter.as
index 29c5d313c0..73286ee5cc 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/SimpleTextHighlighter.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/SimpleTextHighlighter.as
@@ -523,6 +523,7 @@ package org.apache.royale.html
             _textContainer.onblur = onLostFocus;
             //for JS the parentRef is the parent span
             _parentRef = _textContainer;
+            _textContainer.style.font = 'inherit';
             element.appendChild(_textContainer);
             _textContainer.contentEditable = "true";
             goog.events.listen(_textContainer, 'input', textChangeHandler);
diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HighlightTextSpan.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HighlightTextSpan.as
index 2143c757dd..af5a47cd85 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HighlightTextSpan.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HighlightTextSpan.as
@@ -162,7 +162,8 @@ COMPILE::JS{
             COMPILE::JS{
                 if (!_span) {
                     _span = document.createElement('span') as HTMLSpanElement;
-                    element = (_span as WrappedHTMLElement)
+                    _span.style.font = 'inherit';
+                    element = (_span as WrappedHTMLElement);
                     element.royale_wrapper = this;
                     _span.className = 'HighlightTextSpan';
                     var c:String = className;
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/SimpleTextHighlighter.as
 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/SimpleTextHighlighter.as
index 13b42eda1a..2e7de847db 100644
--- 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/SimpleTextHighlighter.as
+++ 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/SimpleTextHighlighter.as
@@ -544,6 +544,7 @@ package mx.controls
             _textContainer.onblur = onLostFocus;
             //for JS the parentRef is the parent span
             _parentRef = _textContainer;
+            _textContainer.style.font = 'inherit';
             element.appendChild(_textContainer);
             _textContainer.contentEditable = "true";
             goog.events.listen(_textContainer, 'input', textChangeHandler);

Reply via email to