Rate Scale Improved

This commit is contained in:
Luis Fernando Molina committed 2020-03-12 17:44:10 +01:00
1 parent baa9fd59c9
commit 9eb6803e70
7 files changed
+99 -12

No files matched your search

+21 -3
View File
@@ -1,12 +1,23 @@
function newVideoRecorder () {
let thisObject = {
recordCanvas: recordCanvas
recordCanvas: recordCanvas,
physics: physics
}
let lastAction
let wheelAnimationCounter = 0
let lastWheelPointerIcon
return thisObject
function physics () {
wheelAnimationCounter--
if (wheelAnimationCounter < 0) {
wheelAnimationCounter = 0
}
}
function recordCanvas () {
{
console.log(canvas.mouse.action, wheelAnimationCounter)
const DISTANCE_BETWEEN_ICONS = 35
const ICON_SIZES = 50
@@ -33,16 +44,24 @@ function newVideoRecorder () {
break
}
case 'wheel': {
wheelAnimationCounter = 25
if (canvas.mouse.event.delta > 0) {
pointerIcon = canvas.designSpace.iconCollection.get('mouse-wheel-up')
lastWheelPointerIcon = pointerIcon
} else {
pointerIcon = canvas.designSpace.iconCollection.get('mouse-wheel-down')
lastWheelPointerIcon = pointerIcon
}
break
}
case 'key down': {
pointerIcon = mousePointerIcon
if (wheelAnimationCounter > 0) {
pointerIcon = lastWheelPointerIcon
} else {
pointerIcon = mousePointerIcon
}
break
}
case 'key up': {
@@ -170,4 +189,3 @@ function newVideoRecorder () {
}
}
}