   # However, this component really does read and write only to the 'undo'
   # part of the state bucket, and we have to get react to update somehow, and
   # we don't want the parent to have to worry about this, so it's in @state.
-  getState: -> {isEnabled: @props.lc.canUndo()}
+  getState: -> {
+    isEnabled: switch
+      when undoOrRedo == 'undo' then @props.lc.canUndo()
+      when undoOrRedo == 'redo' then @props.lc.canRedo()
+  }
   getInitialState: -> @getState()
   mixins: [LC.React.Mixins.UpdateOnDrawingChangeMixin]
 

    )


LC.React.UndoRedo = React.createClass
  displayName: 'UndoRedo'
  render: ->
    {div} = React.DOM
    {lc} = @props
    (div {className: 'lc-undo-redo'},
      LC.React.UndoButton({lc}),
      LC.React.RedoButton({lc})
    )


LC.React.UndoButton = React.createClass
  displayName: 'UndoButton'

  # We do this a lot, even though it reads as a React no-no.
  # The reason is that '@props.lc' is a monolithic state bucket for

      'toolbar-button': true
      'thin-button': true
      'disabled': not @state.isEnabled
    onClick = switch
      when !@state.isEnabled then ->
      when inOrOut == 'in' then -> lc.zoom(0.2)
      when inOrOut == 'out' then -> lc.zoom(-0.2)

    (div {className, onClick}, switch
      when inOrOut == 'in' then '+'
