Animation improvements

This commit is contained in:
Luis Fernando Molina committed 2019-05-20 22:25:46 +02:00
1 parent 8d9f4c4333
commit 82f63c5493
3 files changed
+13 -11

No files matched your search

+2 -1
View File
@@ -104,7 +104,7 @@ function newCircularMenuItem () {
function physics () {
if (thisObject.dontShowAtFullscreen === true && CURRENT_TOP_MARGIN === 0) { return }
const INCREASE_STEP = 0.25
const INCREASE_STEP = 1
if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= INCREASE_STEP) {
if (thisObject.currentRadius < thisObject.targetRadius) {
@@ -256,3 +256,4 @@ function newCircularMenuItem () {
}
}
}
+9 -8
View File
@@ -115,11 +115,11 @@ function newFloatingObject () {
function thisObjectPhysics () {
// The radius also have a target.
if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= 3) {
if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= 15) {
if (thisObject.container.frame.radius < thisObject.targetRadius) {
thisObject.container.frame.radius = thisObject.container.frame.radius + 3
thisObject.container.frame.radius = thisObject.container.frame.radius + 15
} else {
thisObject.container.frame.radius = thisObject.container.frame.radius - 3
thisObject.container.frame.radius = thisObject.container.frame.radius - 15
}
thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
}
@@ -128,19 +128,19 @@ function newFloatingObject () {
if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= 1) {
if (thisObject.currentImageSize < thisObject.targetImageSize) {
thisObject.currentImageSize = thisObject.currentImageSize + 2
thisObject.currentImageSize = thisObject.currentImageSize + 10
} else {
thisObject.currentImageSize = thisObject.currentImageSize - 2
thisObject.currentImageSize = thisObject.currentImageSize - 10
}
}
// The fontSize also have a target.
if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= 0.2) {
if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= 1) {
if (thisObject.currentFontSize < thisObject.targetFontSize) {
thisObject.currentFontSize = thisObject.currentFontSize + 0.2
thisObject.currentFontSize = thisObject.currentFontSize + 1
} else {
thisObject.currentFontSize = thisObject.currentFontSize - 0.2
thisObject.currentFontSize = thisObject.currentFontSize - 1
}
}
@@ -307,3 +307,4 @@ function newFloatingObject () {
function updateRadius () {
}
}
+2 -2
View File
@@ -245,7 +245,7 @@ function newStrategyPart () {
browserCanvasContext.beginPath()
browserCanvasContext.moveTo(position.x, position.y)
browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
browserCanvasContext.strokeStyle = 'rgba(204, 204, 204, 1)'
browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
browserCanvasContext.setLineDash([3, 4])
browserCanvasContext.lineWidth = 2
browserCanvasContext.stroke()
@@ -260,7 +260,7 @@ function newStrategyPart () {
browserCanvasContext.beginPath()
browserCanvasContext.arc(targetPoint.x, targetPoint.y, radius, 0, Math.PI * 2, true)
browserCanvasContext.closePath()
browserCanvasContext.fillStyle = 'rgba(30, 30, 30, 1)'
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
browserCanvasContext.fill()
}
}