mirror of
https://github.com/atom/atom.git
synced 2026-02-18 18:34:21 -05:00
Fix 0-width cursors in presenter instead of view
This commit is contained in:
@@ -7,9 +7,8 @@ CursorComponent = React.createClass
|
||||
displayName: 'CursorComponent'
|
||||
|
||||
render: ->
|
||||
{pixelRect, defaultCharWidth} = @props
|
||||
{pixelRect} = @props
|
||||
{top, left, height, width} = pixelRect
|
||||
width = defaultCharWidth if width is 0
|
||||
WebkitTransform = "translate(#{left}px, #{top}px)"
|
||||
|
||||
div className: 'cursor', style: {height, width, WebkitTransform}
|
||||
|
||||
@@ -21,7 +21,7 @@ CursorsComponent = React.createClass
|
||||
div {className},
|
||||
if presenter?
|
||||
for key, pixelRect of presenter.state.content.cursors
|
||||
CursorComponent({key, pixelRect, defaultCharWidth})
|
||||
CursorComponent({key, pixelRect})
|
||||
|
||||
getInitialState: ->
|
||||
blinkOff: false
|
||||
|
||||
@@ -36,9 +36,7 @@ LinesComponent = React.createClass
|
||||
div {className: 'lines', style},
|
||||
div className: 'placeholder-text', placeholderText if placeholderText?
|
||||
|
||||
CursorsComponent {
|
||||
presenter, cursorBlinkPeriod, cursorBlinkResumeDelay, defaultCharWidth
|
||||
}
|
||||
CursorsComponent {presenter, cursorBlinkPeriod, cursorBlinkResumeDelay}
|
||||
|
||||
HighlightsComponent {
|
||||
editor, highlightDecorations, lineHeightInPixels, defaultCharWidth,
|
||||
|
||||
@@ -99,7 +99,9 @@ class TextEditorPresenter
|
||||
|
||||
for cursor in @model.getCursors()
|
||||
if cursor.isVisible() and startRow <= cursor.getScreenRow() < endRow
|
||||
@state.content.cursors[cursor.id] = @pixelRectForScreenRange(cursor.getScreenRange())
|
||||
pixelRect = @pixelRectForScreenRange(cursor.getScreenRange())
|
||||
pixelRect.width = @getBaseCharacterWidth() if pixelRect.width is 0
|
||||
@state.content.cursors[cursor.id] = pixelRect
|
||||
visibleCursors[cursor.id] = true
|
||||
|
||||
for id of @state.content.cursors
|
||||
|
||||
Reference in New Issue
Block a user