Panel Improvements

This commit is contained in:
Luis Fernando Molina committed 2020-11-11 11:45:41 +01:00
1 parent 3d6bba4cca
commit 7a65afbdb9
4 files changed
+59 -14

No files matched your search

@@ -665,7 +665,7 @@ function newTimeMachine() {
if (description !== undefined) {
label = description
}
UI.projects.superalgos.utilities.drawPrint.printLabel(label, position.x + 20, position.y - 10, opacity, fontSize)
UI.projects.superalgos.utilities.drawPrint.printLabel(label, position.x + 20, undefined, undefined, position.y - 10, opacity, fontSize, undefined, 'Left')
if (icon !== undefined) {
if (icon.canDrawIcon === true) {
@@ -730,7 +730,7 @@ function newTimeMachine() {
}
}
UI.projects.superalgos.utilities.drawPrint.printLabel(exchangeMarket.exchangeName, -5 + xOffSet, -30, opacity, fontSize, UI_COLOR.GREY)
UI.projects.superalgos.utilities.drawPrint.printLabel(exchangeMarket.exchangeName, -5 + xOffSet, undefined, undefined, -30, opacity, fontSize, UI_COLOR.GREY, 'Left')
position.x = position.x + INTER_EXCHANGE_SPACE
@@ -746,7 +746,7 @@ function newTimeMachine() {
}
}
UI.projects.superalgos.utilities.drawPrint.printLabel(exchangeMarket.marketName, -5 + xOffSet, -10, opacity, fontSize, UI_COLOR.GREY)
UI.projects.superalgos.utilities.drawPrint.printLabel(exchangeMarket.marketName, -5 + xOffSet, undefined, undefined, -10, opacity, fontSize, UI_COLOR.GREY, 'Left')
icon = exchangeMarket.quotedAssetIcon
if (icon !== undefined) {
@@ -266,7 +266,7 @@ function newSuperalgosCockpitSpace() {
x: thisObject.container.frame.width / 2,
y: thisObject.container.frame.height / 2 + 5
}
UI.projects.superalgos.utilities.drawPrint.printLabel(statusText, position.x, position.y, 1, 15, textColor, 'Center', thisObject.container)
UI.projects.superalgos.utilities.drawPrint.printLabel(statusText, undefined, position.x, undefined, position.y, 1, 15, textColor, 'Center', thisObject.container)
}
if (UI.projects.superalgos.spaces.designSpace !== undefined) {
@@ -93,7 +93,7 @@ function newPlotterPanel() {
const frameBodyHeight = thisObject.container.frame.getBodyHeight()
const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight
const X_AXIS_A = thisObject.container.frame.width * 7 / 8
const X_AXIS_A = thisObject.container.frame.width * 1 / 8
const X_AXIS_B = thisObject.container.frame.width * 7 / 8
const Y_AXIS = frameTitleHeight + frameBodyHeight / 2
@@ -177,8 +177,37 @@ function newPlotterPanel() {
if (panelData.textStyle.config.paletteColor !== undefined) { paletteColor = eval(panelData.textStyle.config.paletteColor) }
}
UI.projects.superalgos.utilities.drawPrint.printLabel(labelText, X_AXIS_A, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, 'Right', thisObject.container, thisObject.fitFunction)
UI.projects.superalgos.utilities.drawPrint.printLabel(value, X_AXIS_B, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, opacity, fontSize, paletteColor, 'Right', thisObject.container, thisObject.fitFunction, false, true, undefined, true)
UI.projects.superalgos.utilities.drawPrint.printLabel(
labelText,
X_AXIS_A,
undefined,
undefined,
UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor,
'0.60',
undefined,
undefined,
'Left',
thisObject.container,
thisObject.fitFunction
)
UI.projects.superalgos.utilities.drawPrint.printLabel(
value,
X_AXIS_A,
X_AXIS_B,
undefined,
UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor,
opacity,
fontSize,
paletteColor,
'Left Numbers at Right',
thisObject.container,
thisObject.fitFunction,
false,
true,
undefined,
true
)
}
}
}
+23 -7
View File
@@ -188,7 +188,9 @@ function newSuperalgosUtilitiesDrawPrint() {
function printLabel(
labelToPrint,
x,
xLeft,
xRight,
xCenter,
y,
opacity,
fontSize,
@@ -231,35 +233,49 @@ function newSuperalgosUtilitiesDrawPrint() {
switch (align) {
case 'Center': {
labelPoint = {
x: x - getTextWidth(label) / 2,
x: xCenter - getTextWidth(label) / 2,
y: y
}
break
}
case 'Left': {
labelPoint = {
x: x,
x: xLeft,
y: y
}
break
}
case 'Right': {
labelPoint = {
x: x - getTextWidth(label),
x: xRight - getTextWidth(label),
y: y
}
break
}
case 'Left Numbers at Right': {
if (isItANumber === true) {
labelPoint = {
x: xRight - getTextWidth(label),
y: y
}
} else {
labelPoint = {
x: xLeft,
y: y
}
}
break
}
default: {
labelPoint = {
x: x,
x: xCenter - getTextWidth(label) / 2,
y: y
}
}
}
if (isItANumber === true && simulateMonospace === true) {
labelPoint = {
x: x,
x: xRight,
y: y
}
}
@@ -302,7 +318,7 @@ function newSuperalgosUtilitiesDrawPrint() {
if (character === '.') {
if (insignificantPointPossible === true) {
characterOpacity = opacity / 4
}
}
}
if (hasDecimals === true && character === '0' && insignificantZeroPossible === true) {