Bug Fixed, scales well limited
This commit is contained in:
1 parent
a6bf4e1cb8
commit
abb09e18d8
4 files changed
+14
-13
No files matched your search
+2
-7
@@ -1,5 +1,5 @@
|
||||
|
||||
function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2, xExtraOffSet3, icon1, icon2, container, fitFunction) {
|
||||
function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2, xExtraOffSet3, icon1, icon2, container) {
|
||||
let fontSize1 = 10
|
||||
let fontSize2 = 20
|
||||
let fontSize3 = 10
|
||||
@@ -14,8 +14,7 @@ function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2,
|
||||
borderColor: UI_COLOR.RUSTED_RED,
|
||||
castShadow: false,
|
||||
backgroundColor: UI_COLOR.DARK,
|
||||
opacity: OPACITY,
|
||||
fitFunction: fitFunction
|
||||
opacity: OPACITY
|
||||
}
|
||||
|
||||
roundedCornersBackground(params)
|
||||
@@ -32,7 +31,6 @@ function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2,
|
||||
|
||||
labelPoint1 = container.frame.frameThisPoint(labelPoint1)
|
||||
let x = labelPoint1.x
|
||||
labelPoint1 = fitFunction(labelPoint1)
|
||||
labelPoint1.x = x
|
||||
|
||||
browserCanvasContext.font = fontSize1 + 'px ' + UI_FONT.PRIMARY
|
||||
@@ -49,7 +47,6 @@ function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2,
|
||||
}
|
||||
|
||||
labelPoint2 = container.frame.frameThisPoint(labelPoint2)
|
||||
labelPoint2 = fitFunction(labelPoint2)
|
||||
|
||||
browserCanvasContext.font = fontSize2 + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
@@ -65,7 +62,6 @@ function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2,
|
||||
}
|
||||
|
||||
labelPoint3 = container.frame.frameThisPoint(labelPoint3)
|
||||
labelPoint3 = fitFunction(labelPoint3)
|
||||
|
||||
browserCanvasContext.font = fontSize3 + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
@@ -108,4 +104,3 @@ function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -138,6 +138,9 @@ function newRateScale () {
|
||||
upCorner = transformThisPoint(upCorner, limitingContainer)
|
||||
bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
|
||||
|
||||
upCorner = limitingContainer.fitFunction(upCorner, true)
|
||||
bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
|
||||
|
||||
/* Mouse Position Rate Calculation */
|
||||
let ratePoint = {
|
||||
x: 0,
|
||||
@@ -156,7 +159,6 @@ function newRateScale () {
|
||||
|
||||
ratePoint = transformThisPoint(ratePoint, limitingContainer.frame.container)
|
||||
ratePoint.y = mouse.position.y - thisObject.container.frame.height / 2 + thisObject.container.frame.height
|
||||
ratePoint = limitingContainer.fitFunction(ratePoint, true)
|
||||
|
||||
/* Checking against the container limits. */
|
||||
if (ratePoint.x < upCorner.x) { ratePoint.x = upCorner.x }
|
||||
@@ -287,6 +289,6 @@ function newRateScale () {
|
||||
let icon1 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
|
||||
let icon2 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.type)
|
||||
|
||||
drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container, thisObject.fitFunction)
|
||||
drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container)
|
||||
}
|
||||
}
|
||||
@@ -108,6 +108,9 @@ function newTimeFrameScale () {
|
||||
upCorner = transformThisPoint(upCorner, limitingContainer)
|
||||
bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
|
||||
|
||||
upCorner = limitingContainer.fitFunction(upCorner, true)
|
||||
bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
|
||||
|
||||
/* Positioning */
|
||||
timePoint = {
|
||||
x: 0,
|
||||
@@ -116,7 +119,6 @@ function newTimeFrameScale () {
|
||||
|
||||
timePoint = transformThisPoint(timePoint, limitingContainer.frame.container)
|
||||
timePoint.x = mouse.position.x - thisObject.container.frame.width / 2
|
||||
timePoint = limitingContainer.fitFunction(timePoint, true)
|
||||
|
||||
/* Checking against the container limits. */
|
||||
if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x }
|
||||
@@ -226,6 +228,6 @@ function newTimeFrameScale () {
|
||||
let icon1 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
|
||||
let icon2 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.type)
|
||||
|
||||
drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container, thisObject.fitFunction)
|
||||
drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container)
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -138,6 +138,9 @@ function newTimeScale () {
|
||||
upCorner = transformThisPoint(upCorner, limitingContainer)
|
||||
bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
|
||||
|
||||
upCorner = limitingContainer.fitFunction(upCorner, true)
|
||||
bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
|
||||
|
||||
/* Mouse Position Date Calculation */
|
||||
let timePoint = {
|
||||
x: mouse.position.x,
|
||||
@@ -156,7 +159,6 @@ function newTimeScale () {
|
||||
|
||||
timePoint = transformThisPoint(timePoint, limitingContainer.frame.container)
|
||||
timePoint.x = mouse.position.x - thisObject.container.frame.width / 2
|
||||
timePoint = limitingContainer.fitFunction(timePoint)
|
||||
|
||||
/* Checking against the container limits. */
|
||||
if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x }
|
||||
@@ -287,6 +289,6 @@ function newTimeScale () {
|
||||
let icon1 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
|
||||
let icon2 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.type)
|
||||
|
||||
drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container, thisObject.fitFunction)
|
||||
drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user