diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-01-04 01:27:02 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-02-08 21:42:25 +0100 |
commit | 523dddf8b13d85628c74bd13a7e2930a75314e7b (patch) | |
tree | 0a6ce9d6fd6b2cc241c6a78e04ae41894d4ec5ee /packages/renderer | |
parent | feat: Source mapping for stacktraces in dev mode (diff) | |
download | sophie-523dddf8b13d85628c74bd13a7e2930a75314e7b.tar.gz sophie-523dddf8b13d85628c74bd13a7e2930a75314e7b.tar.zst sophie-523dddf8b13d85628c74bd13a7e2930a75314e7b.zip |
fix: Make sure the BrowserView has integer coords
Non-integer coordinates make electron throw the error and the reaction
to synchronize the BrowserView position fail.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/renderer')
-rw-r--r-- | packages/renderer/src/components/BrowserViewPlaceholder.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/renderer/src/components/BrowserViewPlaceholder.tsx b/packages/renderer/src/components/BrowserViewPlaceholder.tsx index 58407ee..f1b6d66 100644 --- a/packages/renderer/src/components/BrowserViewPlaceholder.tsx +++ b/packages/renderer/src/components/BrowserViewPlaceholder.tsx | |||
@@ -34,10 +34,10 @@ export default observer(() => { | |||
34 | if (entry) { | 34 | if (entry) { |
35 | const { x, y, width, height } = entry.target.getBoundingClientRect(); | 35 | const { x, y, width, height } = entry.target.getBoundingClientRect(); |
36 | store.setBrowserViewBounds({ | 36 | store.setBrowserViewBounds({ |
37 | x, | 37 | x: Math.round(x), |
38 | y, | 38 | y: Math.round(y), |
39 | width, | 39 | width: Math.round(width), |
40 | height, | 40 | height: Math.round(height), |
41 | }); | 41 | }); |
42 | } | 42 | } |
43 | }, 100), | 43 | }, 100), |