Fix the Eyedropper tool (#1440)

* Fix eyedropper

* Remove dead code

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-10-25 17:18:15 +01:00
committed by GitHub
co-authored by Keavon Chambers
parent 54745e210a
commit 2feef62f23
5 changed files with 3 additions and 31 deletions
-11
View File
@@ -13,7 +13,6 @@ import {
UpdateWorkingColorsLayout,
UpdateGraphViewOverlayButtonLayout,
UpdateNodeGraphBarLayout,
UpdateDocumentTransform,
TriggerGraphViewOverlay,
} from "@graphite/wasm-communication/messages";
@@ -30,8 +29,6 @@ export function createDocumentState(editor: Editor) {
nodeGraphBarLayout: defaultWidgetLayout(),
// Graph view overlay
graphViewOverlayOpen: false,
// CSS transform property to be applied to artwork
artworkTransform: "",
});
const { subscribe, update } = state;
@@ -106,14 +103,6 @@ export function createDocumentState(editor: Editor) {
// Request a resize event so the viewport gets measured now that the canvas is populated and positioned correctly
window.dispatchEvent(new CustomEvent("resize"));
});
editor.subscriptions.subscribeJsMessage(UpdateDocumentTransform, async (data) => {
await tick();
update((state) => {
state.artworkTransform = data.transform;
return state;
});
});
// Show or hide the graph view overlay
editor.subscriptions.subscribeJsMessage(TriggerGraphViewOverlay, (triggerGraphViewOverlay) => {
update((state) => {