Skip to content

Commit

Permalink
refactor: use rectToClientRect util
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Mar 1, 2023
1 parent 254c8e1 commit 62fb961
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions packages/dom/src/utils/getBoundingClientRect.ts
@@ -1,4 +1,8 @@
import type {ClientRectObject, VirtualElement} from '@floating-ui/core';
import {
ClientRectObject,
rectToClientRect,
VirtualElement,
} from '@floating-ui/core';

import {FALLBACK_SCALE, getScale} from './getScale';
import {isClientRectVisualViewportBased, isElement} from './is';
Expand Down Expand Up @@ -70,14 +74,5 @@ export function getBoundingClientRect(
}
}

return {
width,
height,
top: y,
right: x + width,
bottom: y + height,
left: x,
x,
y,
};
return rectToClientRect({width, height, x, y});
}

0 comments on commit 62fb961

Please sign in to comment.