mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fix fast scroll speed on macos. (#85)
This commit is contained in:
parent
ffcca402ef
commit
429fc7eb68
@ -86,6 +86,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms.
|
||||
- While IP address fetching is now proxy ignored.
|
||||
- Start unmuted on reconnects.
|
||||
- Switched to latest firefox version instead of esr.
|
||||
- Fixed very fast scroll speed on MacOS.
|
||||
|
||||
### Roadmap & TODOs
|
||||
- Catch errors from gst pipeline, tell user if broadcast failed.
|
||||
|
@ -193,6 +193,8 @@
|
||||
// @ts-ignore
|
||||
import GuacamoleKeyboard from '~/utils/guacamole-keyboard.ts'
|
||||
|
||||
const WHEEL_LINE_HEIGHT = 19
|
||||
|
||||
@Component({
|
||||
name: 'neko-video',
|
||||
components: {
|
||||
@ -594,6 +596,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
wheelThrottle = false
|
||||
onWheel(e: WheelEvent) {
|
||||
if (!this.hosting || this.locked) {
|
||||
return
|
||||
@ -603,6 +606,16 @@
|
||||
let x = e.deltaX
|
||||
let y = e.deltaY
|
||||
|
||||
// Pixel units unless it's non-zero.
|
||||
// Note that if deltamode is line or page won't matter since we aren't
|
||||
// sending the mouse wheel delta to the server anyway.
|
||||
// The difference between pixel and line can be important however since
|
||||
// we have a threshold that can be smaller than the line height.
|
||||
if (e.deltaMode !== 0) {
|
||||
x *= WHEEL_LINE_HEIGHT
|
||||
y *= WHEEL_LINE_HEIGHT
|
||||
}
|
||||
|
||||
if (this.scroll_invert) {
|
||||
x = x * -1
|
||||
y = y * -1
|
||||
@ -611,7 +624,14 @@
|
||||
x = Math.min(Math.max(x, -this.scroll), this.scroll)
|
||||
y = Math.min(Math.max(y, -this.scroll), this.scroll)
|
||||
|
||||
if (!this.wheelThrottle) {
|
||||
this.wheelThrottle = true
|
||||
this.$client.sendData('wheel', { x, y })
|
||||
|
||||
window.setTimeout(() => {
|
||||
this.wheelThrottle = false
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
onMouseDown(e: MouseEvent) {
|
||||
|
Loading…
Reference in New Issue
Block a user