Skip to content
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

🤔使用css rotate,加了supportCSSTransform:true,滚动方向还是反向的? #2372

Closed
2 tasks done
LipiAndPili opened this issue Oct 16, 2023 · 1 comment
Closed
2 tasks done
Labels
❔question 疑问/使用问题

Comments

@LipiAndPili
Copy link

LipiAndPili commented Oct 16, 2023

🏷 Version

Package Version
@antv/s2 1.44.0

Sheet Type

  • PivotSheet
  • TableSheet

🖋 Description

业务需要在屏幕过小时或移动端浏览器中将图表强制横屏,使用css transform rotate属性将图表旋转了90度,在配置中添加了supportCSSTransform:true,点击交互都正常,但滚动方向还是翻转之前的方向。

🔗 Reproduce Link

😊 Expected Behavior

翻转后的图表滚动方向按照当前的方向正常滚动

😅 Current Behavior

@LipiAndPili LipiAndPili added the ❔question 疑问/使用问题 label Oct 16, 2023
@lijinke666
Copy link
Member

supportCSSTransform 只是确保 transform 后拿到的坐标是正确的, 表格滚动是不受影响的, 不支持这种场景, 垂直滚动对应 deltaY, 水平滚动对应 deltaX, 你可以提一个 PR, 支持横屏模式, 互换下 deltaX/deltaY 的值, 或者 onWheel 的时候新增一个 hook, 可以自定义 deltaX/deltaY, 以满足你的诉求

if (shiftKey && isWindows()) {
offsetX = offsetX - deltaX + deltaY;
deltaX = deltaY;
offsetY -= deltaY;
deltaY = 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❔question 疑问/使用问题
Projects
None yet
Development

No branches or pull requests

2 participants