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
画像モーダルの挙動の変更 #4071
画像モーダルの挙動の変更 #4071
Conversation
Codecov ReportPatch has no changes to coverable lines. 📢 Thoughts on this report? Let us know!. |
Preview
|
const afterScale = Math.max( | ||
ZOOM_RATIO_MIN, | ||
state.zoomRatio - e.deltaY * WHEEL_ZOOM_SCALE | ||
) |
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.
SPの方はいい感じになってたけど、PCでのctrl+マウスホイールでのズームインがすごく急になってる
前までは ZOOM_STEP ** zoomLevel
でexpで(離散的に)計算してたけど、今ここがlinearになってるからかな
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.
とりあえず試しに指数関数の挙動に変えてみました
あとFirefoxなら一応e.deltaMode
でトラックパッドの場合とマウスホイールの場合を見分けられそうなので係数を別で設定してみました
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.
コードは追えてないのですが、PCのタッチパッド&スマホはよさそうです!ありがとうございます(マウスホイールは僕のが物理的に壊れてるため未確認)
一応approveはしないのですが、PCのマウスホイールで確認してapproveしてくれる人がいたら僕の分もapproveカウントしてしまってOKです
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.
コードはちゃんと見れてないですが(大丈夫そうだと思っています)、挙動はかなり良いです!ありがとうございます!
一応コードをちゃんと見てくれる人がいれば歓迎です
#4063