Bug Fixed: Texts also appearing over the Design Space instead of the Charting Space

This commit is contained in:
Luis Fernando Molina committed 2021-01-31 18:01:57 +01:00
1 parent a5634aa38e
commit 465cecb729
2 files changed
+10 -9

No files matched your search

@@ -10,7 +10,7 @@ function newSuperalgosChartingSpace() {
const MODULE_NAME = 'Charting Space'
const ERROR_LOG = true
const logger = newWebDebugLog()
let thisObject = {
visible: false,
@@ -252,8 +252,8 @@ function newSuperalgosChartingSpace() {
returnPoint.y = COCKPIT_SPACE_POSITION
}
} else {
if (point.y > COCKPIT_SPACE_POSITION) {
returnPoint.y = COCKPIT_SPACE_POSITION
if (point.y > COCKPIT_SPACE_POSITION ) {
returnPoint.y = COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT / 2
}
}
@@ -816,12 +816,12 @@ function newPlotter() {
imagePosition.x = dataPoint.x - imageSize / 2 + offsetX
imagePosition.y = dataPoint.y - imageSize / 2 - offsetY
imagePosition = thisObject.fitFunction(imagePosition)
imagePosition = thisObject.fitFunction(imagePosition, true)
let imageToDraw = UI.projects.superalgos.spaces.designSpace.getIconByProjectAndName('Superalgos', imageName)
if (imageToDraw !== undefined) {
if (imageToDraw.canDrawIcon === true) {
browserCanvasContext.drawImage(imageToDraw, imagePosition.x , imagePosition.y , imageSize, imageSize)
browserCanvasContext.drawImage(imageToDraw, imagePosition.x, imagePosition.y, imageSize, imageSize)
}
} else {
console.log('Can not plot image named ' + imageName + ' of product ' + productDefinition.name + ' because it does not exist.')
@@ -860,14 +860,15 @@ function newPlotter() {
y: dataPointObject.y
}
dataPoint = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
dataPoint = thisObject.fitFunction(dataPoint)
textPosition.x = dataPoint.x
textPosition.y = dataPoint.y
textPosition.x = dataPoint.x + offsetX
textPosition.y = dataPoint.y - offsetY
textPosition = thisObject.fitFunction(textPosition)
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + paletteColor + ', ' + opacity + ')'
browserCanvasContext.fillText(value, textPosition.x + offsetX, textPosition.y - offsetY)
browserCanvasContext.fillText(value, textPosition.x, textPosition.y)
}
}
}