kopia lustrzana https://github.com/Tldraw/Tldraw
alex/auto-undo-redo: fix
rodzic
e341dbea06
commit
5ec172f3cd
|
@ -7861,22 +7861,24 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
}
|
||||
|
||||
// todo: We only have to do this if there are multiple users in the document
|
||||
this.store.put([
|
||||
{
|
||||
id: TLPOINTER_ID,
|
||||
typeName: 'pointer',
|
||||
x: currentPagePoint.x,
|
||||
y: currentPagePoint.y,
|
||||
lastActivityTimestamp:
|
||||
// If our pointer moved only because we're following some other user, then don't
|
||||
// update our last activity timestamp; otherwise, update it to the current timestamp.
|
||||
info.type === 'pointer' && info.pointerId === INTERNAL_POINTER_IDS.CAMERA_MOVE
|
||||
? this.store.unsafeGetWithoutCapture(TLPOINTER_ID)?.lastActivityTimestamp ??
|
||||
this._tickManager.now
|
||||
: this._tickManager.now,
|
||||
meta: {},
|
||||
},
|
||||
])
|
||||
this.history.ignore(() => {
|
||||
this.store.put([
|
||||
{
|
||||
id: TLPOINTER_ID,
|
||||
typeName: 'pointer',
|
||||
x: currentPagePoint.x,
|
||||
y: currentPagePoint.y,
|
||||
lastActivityTimestamp:
|
||||
// If our pointer moved only because we're following some other user, then don't
|
||||
// update our last activity timestamp; otherwise, update it to the current timestamp.
|
||||
info.type === 'pointer' && info.pointerId === INTERNAL_POINTER_IDS.CAMERA_MOVE
|
||||
? this.store.unsafeGetWithoutCapture(TLPOINTER_ID)?.lastActivityTimestamp ??
|
||||
this._tickManager.now
|
||||
: this._tickManager.now,
|
||||
meta: {},
|
||||
},
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,7 +96,7 @@ export function logHistory(history: HistoryManager<any>) {
|
|||
for (const undo of undos) {
|
||||
if (!undo) continue
|
||||
if (undo.type === 'stop') {
|
||||
p.log('- Stop', undo.id)
|
||||
p.log('Stop', undo.id)
|
||||
} else {
|
||||
p.log('- Diff')
|
||||
p.indent()
|
||||
|
|
|
@ -142,12 +142,12 @@ export const InstancePageStateRecordType = createRecordType<TLInstancePageState>
|
|||
pageId: false,
|
||||
selectedShapeIds: false,
|
||||
editingShapeId: false,
|
||||
croppingShapeId: false,
|
||||
meta: false,
|
||||
|
||||
hintingShapeIds: true,
|
||||
erasingShapeIds: true,
|
||||
hoveredShapeId: true,
|
||||
croppingShapeId: true,
|
||||
focusedGroupId: true,
|
||||
},
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue