We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
调整如下:增加滚动条位置因素
export function getOffset(evt, target = null) { const { clientX, clientY, currentTarget } = evt
const current = target || currentTarget const scrollTop = current.scrollTop const scrollLeft = current.scrollLeft const { left, top } = current.getBoundingClientRect()
return [clientX - left + scrollLeft, clientY - top + scrollTop] }
The text was updated successfully, but these errors were encountered:
是存在这个问题,初始设计的时候默认节点外层容器不存在滚动情况。会在后续版本中完善。
Sorry, something went wrong.
求大神指点 画布用transform 缩放后鼠标操作位置产生偏移
No branches or pull requests
调整如下:增加滚动条位置因素
export function getOffset(evt, target = null) {
const {
clientX,
clientY,
currentTarget
} = evt
const current = target || currentTarget
const scrollTop = current.scrollTop
const scrollLeft = current.scrollLeft
const {
left,
top
} = current.getBoundingClientRect()
return [clientX - left + scrollLeft, clientY - top + scrollTop]
}
The text was updated successfully, but these errors were encountered: