mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Update cursors when the line height in pixels changes
This commit is contained in:
@@ -384,6 +384,12 @@ describe "EditorComponent", ->
|
||||
expect(cursorNodes.length).toBe 1
|
||||
expect(cursorNodes[0].style['-webkit-transform']).toBe "translate3d(#{8 * charWidth}px, #{6 * lineHeightInPixels}px, 0px)"
|
||||
|
||||
it "updates cursor positions when the line height changes", ->
|
||||
editor.setCursorBufferPosition([1, 10])
|
||||
cursorNode = node.querySelector('.cursor')
|
||||
component.setLineHeight(2)
|
||||
expect(cursorNode.style['-webkit-transform']).toBe "translate3d(#{10 * editor.getDefaultCharWidth()}px, #{editor.getLineHeightInPixels()}px, 0px)"
|
||||
|
||||
describe "selection rendering", ->
|
||||
[scrollViewNode, scrollViewClientLeft] = []
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ CursorsComponent = React.createClass
|
||||
@stopBlinkingCursors()
|
||||
|
||||
shouldComponentUpdate: (newProps, newState) ->
|
||||
not isEqualForProperties(newProps, @props, 'cursorScreenRanges', 'scrollTop', 'scrollLeft') or
|
||||
not newState.blinkOff is @state.blinkOff
|
||||
not newState.blinkOff is @state.blinkOff or
|
||||
not isEqualForProperties(newProps, @props, 'cursorScreenRanges', 'scrollTop', 'scrollLeft', 'lineHeightInPixels')
|
||||
|
||||
componentWillUpdate: (newProps) ->
|
||||
@pauseCursorBlinking() if @props.cursorScreenRanges and not isEqual(newProps.cursorScreenRanges, @props.cursorScreenRanges)
|
||||
|
||||
Reference in New Issue
Block a user