mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
19 lines
600 B
CoffeeScript
19 lines
600 B
CoffeeScript
React = require 'react-atom-fork'
|
|
{div} = require 'reactionary-atom-fork'
|
|
{isEqualForProperties} = require 'underscore-plus'
|
|
|
|
module.exports =
|
|
CursorComponent = React.createClass
|
|
displayName: 'CursorComponent'
|
|
|
|
render: ->
|
|
{pixelRect, defaultCharWidth} = @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}
|
|
|
|
shouldComponentUpdate: (newProps) ->
|
|
not isEqualForProperties(newProps, @props, 'pixelRect', 'defaultCharWidth')
|