Skip to content

Commit d80e240

Browse files
committed
chore: adjust
1 parent 343f433 commit d80e240

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hooks/useAlign.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ export default function useAlign(
703703
}
704704

705705
if (scaleY === 1) {
706-
nextOffsetY = Math.round(nextOffsetY);
707-
offsetY4Bottom = Math.round(offsetY4Bottom);
706+
nextOffsetY = Math.floor(nextOffsetY);
707+
offsetY4Bottom = Math.floor(offsetY4Bottom);
708708
}
709709

710710
const nextOffsetInfo = {

tests/align.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ describe('Trigger.Align', () => {
272272
});
273273
});
274274

275-
it('round when decimal precision', async () => {
275+
it('floor when decimal precision', async () => {
276276
rectX = 22.6;
277277
rectY = 33.4;
278278
rectWidth = 33.7;
@@ -293,7 +293,7 @@ describe('Trigger.Align', () => {
293293
await awaitFakeTimer();
294294

295295
expect(document.querySelector('.rc-trigger-popup')).toHaveStyle({
296-
top: `56px`,
296+
top: `55px`,
297297
});
298298
});
299299

0 commit comments

Comments
 (0)