File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
packages/app-frontend/src/features/timeline Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -102,23 +102,12 @@ export default defineComponent({
102
102
microTasks .push ([task , priority ])
103
103
}
104
104
105
- // Get pixel position for giver time
106
-
107
- let timePositionCache : Record < number , number > = {}
105
+ /**
106
+ * Get pixel position for giver time
107
+ */
108
108
function getTimePosition (time : number ) {
109
- let result = timePositionCache [time ]
110
- if (result == null ) {
111
- result = (time - nonReactiveState .minTime .value ) / (nonReactiveState .endTime .value - nonReactiveState .startTime .value ) * app .view .width / window .devicePixelRatio
112
- timePositionCache [time ] = result
113
- }
114
- return result
115
- }
116
- function resetTimePositionCache () {
117
- timePositionCache = {}
109
+ return (time - nonReactiveState .minTime .value ) / (nonReactiveState .endTime .value - nonReactiveState .startTime .value ) * app .view .width / window .devicePixelRatio
118
110
}
119
- watch (minTime , resetTimePositionCache )
120
- watch (endTime , resetTimePositionCache )
121
- watch (startTime , resetTimePositionCache )
122
111
123
112
// Reset
124
113
@@ -1329,7 +1318,6 @@ export default defineComponent({
1329
1318
app .queueResize ()
1330
1319
nextTick (() => {
1331
1320
mainRenderTexture ?.resize (app .view .width , app .view .height )
1332
- resetTimePositionCache ()
1333
1321
queueEventsUpdate ()
1334
1322
drawLayerBackgroundEffects ()
1335
1323
drawTimeCursor ()
You can’t perform that action at this time.
0 commit comments