Keeping backwards compatibility with files made in older logarithmplotter versions (but keeping them from being created again).
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
3afa9d0c8e
commit
c86eed95ca
2 changed files with 12 additions and 0 deletions
|
@ -84,9 +84,11 @@ class Point extends Common.DrawableObject {
|
|||
ctx.font = `${canvas.textsize}px sans-serif`
|
||||
var textSize = ctx.measureText(text).width
|
||||
switch(this.labelPosition) {
|
||||
case 'top':
|
||||
case 'above':
|
||||
canvas.drawVisibleText(ctx, text, canvasX-textSize/2, canvasY-16)
|
||||
break;
|
||||
case 'bottom':
|
||||
case 'below':
|
||||
canvas.drawVisibleText(ctx, text, canvasX-textSize/2, canvasY+16)
|
||||
break;
|
||||
|
@ -96,15 +98,19 @@ class Point extends Common.DrawableObject {
|
|||
case 'right':
|
||||
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY+4)
|
||||
break;
|
||||
case 'top-left':
|
||||
case 'above-left':
|
||||
canvas.drawVisibleText(ctx, text, canvasX-textSize-10, canvasY-16)
|
||||
break;
|
||||
case 'top-right':
|
||||
case 'above-right':
|
||||
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY-16)
|
||||
break;
|
||||
case 'bottom-left':
|
||||
case 'below-left':
|
||||
canvas.drawVisibleText(ctx, text, canvasX-textSize-10, canvasY+16)
|
||||
break;
|
||||
case 'bottom-right':
|
||||
case 'below-right':
|
||||
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY+16)
|
||||
break;
|
||||
|
|
|
@ -69,9 +69,11 @@ class Text extends Common.DrawableObject {
|
|||
case 'center':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY+4)
|
||||
break;
|
||||
case 'top':
|
||||
case 'above':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY-16)
|
||||
break;
|
||||
case 'bottom':
|
||||
case 'below':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY+16)
|
||||
break;
|
||||
|
@ -81,15 +83,19 @@ class Text extends Common.DrawableObject {
|
|||
case 'right':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY+4)
|
||||
break;
|
||||
case 'top-left':
|
||||
case 'above-left':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize-5, canvasY-16)
|
||||
break;
|
||||
case 'top-right':
|
||||
case 'above-right':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY-16)
|
||||
break;
|
||||
case 'bottom-left':
|
||||
case 'below-left':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize-5, canvasY+16)
|
||||
break;
|
||||
case 'bottom-right':
|
||||
case 'below-right':
|
||||
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY+16)
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue