Created
February 2, 2021 20:10
-
-
Save jasonLaster/c38c39657a5c7cf50193b47b5ee7e371 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/protocol/graphics.ts b/src/protocol/graphics.ts | |
index de57eb74..a7fbbdc4 100644 | |
--- a/src/protocol/graphics.ts | |
+++ b/src/protocol/graphics.ts | |
@@ -115,8 +115,10 @@ function onMouseEvents(events: MouseEvent[], store: UIStore) { | |
store.dispatch(actions.setEventsForType(gMouseClickEvents, "mousedown")); | |
} | |
+let onCanvasUpdate = details => {}; | |
+ | |
export function setupGraphics(store: UIStore) { | |
- gStore = store; | |
+ onCanvasUpdate = details => store.dispatch(actions.setCanvas(details)); | |
ThreadFront.sessionWaiter.promise.then((sessionId: string) => { | |
client.Graphics.findPaints({}, sessionId); | |
@@ -355,16 +357,14 @@ export function refreshGraphics() { | |
} | |
} | |
- gStore.dispatch( | |
- actions.setCanvas({ | |
- scale, | |
- gDevicePixelRatio, | |
- width: image.width, | |
- height: image.height, | |
- left: offsetLeft, | |
- top: offsetTop, | |
- }) | |
- ); | |
+ onCanvasUpdate({ | |
+ scale, | |
+ gDevicePixelRatio, | |
+ width: image.width, | |
+ height: image.height, | |
+ left: offsetLeft, | |
+ top: offsetTop, | |
+ }); | |
// Apply the same transforms to any displayed highlighter. | |
const highlighterContainer = document.querySelector(".highlighter-container") as HTMLElement; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment