-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixbug: 页面有zoom放大缩小时,自动定位位置不符合预期 #55 #69
base: master
Are you sure you want to change the base?
Conversation
当页面存在缩放的时候, 在计算 offset 相对位置时将缩放比例放进去, 使其变成真实偏移量。 |
if ('left' in offset) { | ||
resultXY.x = originalXY.x + offset.left - originalOffset.left; | ||
} | ||
if ('top' in offset) { | ||
resultXY.y = originalXY.y + offset.top - originalOffset.top; | ||
resultXY.y = originalXY.y + offset.top - originalOffset.top ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resultXY.y = originalXY.y + offset.top - originalOffset.top ; | |
resultXY.y = originalXY.y + offset.top - originalOffset.top; |
examples/simple.js
Outdated
@@ -154,3 +155,6 @@ const div = ( | |||
); | |||
|
|||
ReactDOM.render(div, $id('__react-content')); | |||
|
|||
document.body.style.transform = 'scale(0.9)' | |||
document.body.style.transformOrigin = 'top left' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单独开个例子演示这个?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已删除, 并增加了新的例子 scale.js
@zombieJ 这个问题切到 @rc-component/trigger 后能解么? |
能,新的实现是直接按照最终画板计算的:https://ant.design/docs/blog/tooltip-align-cn#%E7%BC%A9%E6%94%BE%E6%AF%94 |
不发版吗 |
#55