From 8f98f2368b4f78ce69c97cf84aad36eb7fc7431b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 2 Jun 2014 12:38:26 +0900 Subject: [PATCH] Base gutter updates on defaultCharWidth instead of fontSize/Family --- src/editor-component.coffee | 2 +- src/gutter-component.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor-component.coffee b/src/editor-component.coffee index 75cb2031b..fe1b6d0af 100644 --- a/src/editor-component.coffee +++ b/src/editor-component.coffee @@ -70,7 +70,7 @@ EditorComponent = React.createClass div className: className, style: {fontSize, lineHeight, fontFamily}, tabIndex: -1, GutterComponent { ref: 'gutter', editor, renderedRowRange, maxLineNumberDigits, - scrollTop, scrollHeight, lineHeight, lineHeightInPixels, fontSize, fontFamily, + scrollTop, scrollHeight, lineHeight, lineHeightInPixels, defaultCharWidth, @pendingChanges, onWidthChanged: @onGutterWidthChanged, mouseWheelScreenRow } diff --git a/src/gutter-component.coffee b/src/gutter-component.coffee index 22d9b224a..3e8ec8048 100644 --- a/src/gutter-component.coffee +++ b/src/gutter-component.coffee @@ -34,7 +34,7 @@ GutterComponent = React.createClass # visible row range. shouldComponentUpdate: (newProps) -> return true unless isEqualForProperties(newProps, @props, - 'renderedRowRange', 'scrollTop', 'lineHeightInPixels', 'fontSize', + 'renderedRowRange', 'scrollTop', 'lineHeightInPixels', 'defaultCharWidth', 'mouseWheelScreenRow' ) @@ -49,7 +49,7 @@ GutterComponent = React.createClass @updateDummyLineNumber() @removeLineNumberNodes() - @measureWidth() unless @lastMeasuredWidth? and isEqualForProperties(oldProps, @props, 'maxLineNumberDigits', 'fontSize', 'fontFamily') + @measureWidth() unless @lastMeasuredWidth? and isEqualForProperties(oldProps, @props, 'maxLineNumberDigits', 'defaultCharWidth') @clearScreenRowCaches() unless oldProps.lineHeightInPixels is @props.lineHeightInPixels @updateLineNumbers()