fix(ui): mouse trail setting fixes
This commit is contained in:
parent
4e488f534c
commit
aba75d1124
2 changed files with 13 additions and 8 deletions
|
|
@ -4,10 +4,12 @@ import { HOVER_CLASSNAME } from '../messages/rewriter/constants'
|
|||
import ListWalker from '../../common/ListWalker'
|
||||
import MouseTrail from '../addons/MouseTrail'
|
||||
import styles from './trail.module.css'
|
||||
import { MOUSE_TRAIL } from "App/constants/storageKeys";
|
||||
|
||||
export default class MouseMoveManager extends ListWalker<MouseMove> {
|
||||
private hoverElements: Array<Element> = []
|
||||
private mouseTrail: MouseTrail
|
||||
private mouseTrail: MouseTrail | undefined
|
||||
private removeMouseTrail = false
|
||||
|
||||
constructor(private screen: Screen) {
|
||||
super()
|
||||
|
|
@ -15,13 +17,16 @@ export default class MouseMoveManager extends ListWalker<MouseMove> {
|
|||
canvas.id = 'openreplay-mouse-trail'
|
||||
canvas.className = styles.canvas
|
||||
|
||||
this.mouseTrail = new MouseTrail(canvas)
|
||||
this.removeMouseTrail = localStorage.getItem(MOUSE_TRAIL) === 'false'
|
||||
if (!this.removeMouseTrail) {
|
||||
this.mouseTrail = new MouseTrail(canvas)
|
||||
}
|
||||
|
||||
this.screen.overlay.appendChild(canvas)
|
||||
this.mouseTrail.createContext()
|
||||
this.mouseTrail?.createContext()
|
||||
|
||||
const updateSize = (w: number, h: number) => {
|
||||
return this.mouseTrail.resizeCanvas(w, h)
|
||||
return this.mouseTrail?.resizeCanvas(w, h)
|
||||
}
|
||||
|
||||
this.screen.setOnUpdate(updateSize)
|
||||
|
|
@ -54,7 +59,7 @@ export default class MouseMoveManager extends ListWalker<MouseMove> {
|
|||
this.screen.cursor.move(lastMouseMove)
|
||||
//window.getComputedStyle(this.screen.getCursorTarget()).cursor === 'pointer' // might influence performance though
|
||||
this.updateHover()
|
||||
this.mouseTrail.leaveTrail(lastMouseMove.x, lastMouseMove.y)
|
||||
this.mouseTrail?.leaveTrail(lastMouseMove.x, lastMouseMove.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
# 9.0.0
|
||||
|
||||
- Option to disable string dictionary `{disableStringDict: true` in Tracker constructor
|
||||
- Option to disable string dictionary `{disableStringDict: true}` in Tracker constructor
|
||||
- Introduced Feature flags api
|
||||
- Fixed input durations recorded on programmable autofill
|
||||
- change InputMode from enum to const Object
|
||||
|
||||
# 8.1.2
|
||||
|
||||
- option to disable string dictionary `{disableStringDict: true` in Tracker constructor
|
||||
- option to disable string dictionary `{disableStringDict: true}` in Tracker constructor
|
||||
|
||||
# 8.1.1
|
||||
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
# 7.0.4
|
||||
|
||||
- option to disable string dictionary `{disableStringDict: true` in Tracker constructor
|
||||
- option to disable string dictionary `{disableStringDict: true}` in Tracker constructor
|
||||
|
||||
# 7.0.3
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue