MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / push

Method push

ui/media/js/image-editor.js:338–349  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

336 this.rewind_index = 0 // how many events back into the history we've rewound to. (current state is just after event at index 'length - this.rewind_index - 1')
337 }
338 push(event) {
339 // probably add something here eventually to save state every x events
340 if (this.rewind_index != 0) {
341 this.events = this.events.slice(0, 0 - this.rewind_index)
342 this.rewind_index = 0
343 }
344 var snapshot_frequency = 20 // (every x edits, take a snapshot of the current drawing state, for faster rewinding)
345 if (this.events.length > 0 && this.events.length % snapshot_frequency == 0) {
346 event.snapshot = this.editor.layers.drawing.ctx.getImageData(0, 0, this.editor.width, this.editor.height)
347 }
348 this.events.push(event)
349 }
350 pushAction(action) {
351 this.push({
352 type: "action",

Callers 15

pushActionMethod · 0.95
editEndMethod · 0.95
continueTasksFunction · 0.80
seFunction · 0.80
ueFunction · 0.80
TeFunction · 0.80
CeFunction · 0.80
EeFunction · 0.80
hFunction · 0.80
TFunction · 0.80
xeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected