From 47f3b562b5300531fce842e1587451211d69299a Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Tue, 18 Mar 2014 16:03:42 -0700 Subject: [PATCH] add getter for editorLineHeight --- src/editor-view.coffee | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 8c58ded79..681e347b1 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -745,15 +745,25 @@ class EditorView extends View @redraw() - setEditorLineHeight: (editorLineHeight) -> - @css('line-height', editorLineHeight) - @redraw() - # Public: Gets the font family for the editor. # # Returns a {String} identifying the CSS `font-family`. getFontFamily: -> @css("font-family") + # Public: Sets the line height of the editor + # + # editorLineHeight - A {Number} without a unit suffix identifying the CSS + # `line-height`. + setEditorLineHeight: (editorLineHeight) -> + @css('line-height', editorLineHeight) + @redraw() + + # Public: Gets the line height for the editor + # + # Returns a {Float} identifying the CSS line-height. + getLineHeight: -> + parseFloat(@css('line-height')) + # Public: Redraw the editor redraw: -> return unless @hasParent()