Skip to content

Commit

Permalink
fix(SizeObserver): new network don't properly handle native js type
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Apr 17, 2024
1 parent 8bde9c6 commit d9f9871
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vue2-app/src/components/SizeObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default {
const elem = ref(null);

function resize() {
const size = elem.value.getBoundingClientRect();
const { x, y, width, height } = elem.value.getBoundingClientRect();
const size = { x, y, width, height };
const pixelRatio = window.devicePixelRatio;
const dpi = 96 * pixelRatio;
const event = { size, pixelRatio, dpi };
Expand Down
3 changes: 2 additions & 1 deletion vue3-app/src/components/TrameSizeObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default {
const elem = ref(null);

function resize() {
const size = elem.value.getBoundingClientRect();
const { x, y, width, height } = elem.value.getBoundingClientRect();
const size = { x, y, width, height };
const pixelRatio = window.devicePixelRatio;
const dpi = 96 * pixelRatio;
const event = { size, pixelRatio, dpi };
Expand Down

0 comments on commit d9f9871

Please sign in to comment.