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

zjffdu pushed a commit to branch web_angular
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/web_angular by this push:
     new 3d5ff88  [ZEPPELIN-4540] Convert code editor font size units
3d5ff88 is described below

commit 3d5ff889a7a1333e8dd043e0132b3144f72360ae
Author: Hsuan Lee <hsua...@gmail.com>
AuthorDate: Tue Jan 7 09:47:56 2020 +0800

    [ZEPPELIN-4540] Convert code editor font size units
    
    ### What is this PR for?
    
    Convert code editor font size units (from pt to px).
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/browse/ZEPPELIN-4540
    
    ### How should this be tested?
    
    N/A
    
    ### Screenshots (if appropriate)
    
    N/A
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Hsuan Lee <hsua...@gmail.com>
    
    Closes #3588 from hsuanxyz/fix/code-editor-font-size and squashes the 
following commits:
    
    3778a12ce [Hsuan Lee] fix: convert code editor font size units
---
 .../paragraph/code-editor/code-editor.component.ts        |  3 ++-
 .../src/app/utility/css-unit-conversion.ts                | 15 +++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git 
a/zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts
 
b/zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts
index bfae433..99cc97d 100644
--- 
a/zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts
+++ 
b/zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts
@@ -31,6 +31,7 @@ import IEditor = monaco.editor.IEditor;
 import { InterpreterBindingItem } from '@zeppelin/sdk';
 import { CompletionService, MessageService } from '@zeppelin/services';
 
+import { pt2px } from '@zeppelin/utility/css-unit-conversion';
 import { NotebookParagraphControlComponent } from 
'../control/control.component';
 
 @Component({
@@ -139,7 +140,7 @@ export class NotebookParagraphCodeEditorComponent 
implements OnChanges, OnDestro
     if (this.editor) {
       this.editor.updateOptions({
         readOnly: this.readOnly,
-        fontSize: this.fontSize,
+        fontSize: pt2px(this.fontSize),
         renderLineHighlight: this.focus ? 'all' : 'none',
         minimap: { enabled: false },
         lineNumbers: this.lineNumbers ? 'on' : 'off',
diff --git a/zeppelin-web-angular/src/app/utility/css-unit-conversion.ts 
b/zeppelin-web-angular/src/app/utility/css-unit-conversion.ts
new file mode 100644
index 0000000..19d4057
--- /dev/null
+++ b/zeppelin-web-angular/src/app/utility/css-unit-conversion.ts
@@ -0,0 +1,15 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export function pt2px(pt: number): number {
+  return pt / (3 / 4);
+}

Reply via email to