Redo the first event in the redo stack. Returns false if the stack is empty.
()
| 302 | |
| 303 | // Redo the first event in the redo stack. Returns false if the stack is empty. |
| 304 | func (eh *EventHandler) Redo() bool { |
| 305 | t := eh.RedoStack.Peek() |
| 306 | if t == nil { |
| 307 | return false |
| 308 | } |
| 309 | |
| 310 | startTime := t.Time.UnixNano() / int64(time.Millisecond) |
| 311 | endTime := startTime - (startTime % undoThreshold) + undoThreshold |
| 312 | |
| 313 | for { |
| 314 | t = eh.RedoStack.Peek() |
| 315 | if t == nil { |
| 316 | break |
| 317 | } |
| 318 | |
| 319 | if t.Time.UnixNano()/int64(time.Millisecond) > endTime { |
| 320 | break |
| 321 | } |
| 322 | |
| 323 | eh.RedoOneEvent() |
| 324 | } |
| 325 | return true |
| 326 | } |
| 327 | |
| 328 | // RedoOneEvent redoes one event |
| 329 | func (eh *EventHandler) RedoOneEvent() { |
nothing calls this directly
no test coverage detected