Files
atom/src/cursor-component.coffee
Nathan Sobo 070d239f41 Blink cursors with a CSS animation
Now that they're on their own layer, I don't think it affects the
repaint timing when typing on lines (if it ever did).
2014-05-16 15:31:13 -06:00

16 lines
431 B
CoffeeScript

React = require 'react'
{div} = require 'reactionary'
module.exports =
CursorComponent = React.createClass
displayName: 'CursorComponent'
render: ->
{cursor, scrollTop, scrollLeft} = @props
{top, left, height, width} = cursor.getPixelRect()
top -= scrollTop
left -= scrollLeft
WebkitTransform = "translate3d(#{left}px, #{top}px, 0px)"
div className: 'cursor', style: {height, width, WebkitTransform}