mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 03:08:12 +08:00
Add handler for deferred execution of messages (#2951)
* Add Handler for defered execution of messages * Cleanup * Track graph execution id to associate messages with their corresponding execution id * Rename ViewportReady -> NavigationReady * Defer layer deselection
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
||||
UpdateWorkingColorsLayout,
|
||||
UpdateNodeGraphControlBarLayout,
|
||||
UpdateGraphViewOverlay,
|
||||
TriggerDelayedZoomCanvasToFitAll,
|
||||
UpdateGraphFadeArtwork,
|
||||
} from "@graphite/messages";
|
||||
|
||||
@@ -94,12 +93,6 @@ export function createDocumentState(editor: Editor) {
|
||||
return state;
|
||||
});
|
||||
});
|
||||
editor.subscriptions.subscribeJsMessage(TriggerDelayedZoomCanvasToFitAll, () => {
|
||||
// TODO: This is horribly hacky
|
||||
[0, 1, 10, 50, 100, 200, 300, 400, 500].forEach((delay) => {
|
||||
setTimeout(() => editor.handle.zoomCanvasToFitAll(), delay);
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
|
||||
Reference in New Issue
Block a user