Skip to content

Conversation

@lin-123
Copy link

@lin-123 lin-123 commented Dec 22, 2022

#55

@lin-123
Copy link
Author

lin-123 commented Dec 23, 2022

当页面存在缩放的时候, 在计算 offset 相对位置时将缩放比例放进去, 使其变成真实偏移量。

}
if ('top' in offset) {
resultXY.y = originalXY.y + offset.top - originalOffset.top;
resultXY.y = originalXY.y + offset.top - originalOffset.top ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resultXY.y = originalXY.y + offset.top - originalOffset.top ;
resultXY.y = originalXY.y + offset.top - originalOffset.top;

ReactDOM.render(div, $id('__react-content'));

document.body.style.transform = 'scale(0.9)'
document.body.style.transformOrigin = 'top left'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单独开个例子演示这个?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已删除, 并增加了新的例子 scale.js

@afc163
Copy link
Contributor

afc163 commented Feb 22, 2023

@zombieJ 这个问题切到 @rc-component/trigger 后能解么?

@zombieJ
Copy link
Collaborator

zombieJ commented Feb 27, 2023

@zombieJ 这个问题切到 @rc-component/trigger 后能解么?

能,新的实现是直接按照最终画板计算的:https://ant.design/docs/blog/tooltip-align-cn#%E7%BC%A9%E6%94%BE%E6%AF%94

@wygkzqa
Copy link

wygkzqa commented May 29, 2023

不发版吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants