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`
|
ctx.font = `${canvas.textsize}px sans-serif`
|
||||||
var textSize = ctx.measureText(text).width
|
var textSize = ctx.measureText(text).width
|
||||||
switch(this.labelPosition) {
|
switch(this.labelPosition) {
|
||||||
|
case 'top':
|
||||||
case 'above':
|
case 'above':
|
||||||
canvas.drawVisibleText(ctx, text, canvasX-textSize/2, canvasY-16)
|
canvas.drawVisibleText(ctx, text, canvasX-textSize/2, canvasY-16)
|
||||||
break;
|
break;
|
||||||
|
case 'bottom':
|
||||||
case 'below':
|
case 'below':
|
||||||
canvas.drawVisibleText(ctx, text, canvasX-textSize/2, canvasY+16)
|
canvas.drawVisibleText(ctx, text, canvasX-textSize/2, canvasY+16)
|
||||||
break;
|
break;
|
||||||
|
@ -96,15 +98,19 @@ class Point extends Common.DrawableObject {
|
||||||
case 'right':
|
case 'right':
|
||||||
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY+4)
|
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY+4)
|
||||||
break;
|
break;
|
||||||
|
case 'top-left':
|
||||||
case 'above-left':
|
case 'above-left':
|
||||||
canvas.drawVisibleText(ctx, text, canvasX-textSize-10, canvasY-16)
|
canvas.drawVisibleText(ctx, text, canvasX-textSize-10, canvasY-16)
|
||||||
break;
|
break;
|
||||||
|
case 'top-right':
|
||||||
case 'above-right':
|
case 'above-right':
|
||||||
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY-16)
|
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY-16)
|
||||||
break;
|
break;
|
||||||
|
case 'bottom-left':
|
||||||
case 'below-left':
|
case 'below-left':
|
||||||
canvas.drawVisibleText(ctx, text, canvasX-textSize-10, canvasY+16)
|
canvas.drawVisibleText(ctx, text, canvasX-textSize-10, canvasY+16)
|
||||||
break;
|
break;
|
||||||
|
case 'bottom-right':
|
||||||
case 'below-right':
|
case 'below-right':
|
||||||
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY+16)
|
canvas.drawVisibleText(ctx, text, canvasX+10, canvasY+16)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -69,9 +69,11 @@ class Text extends Common.DrawableObject {
|
||||||
case 'center':
|
case 'center':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY+4)
|
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY+4)
|
||||||
break;
|
break;
|
||||||
|
case 'top':
|
||||||
case 'above':
|
case 'above':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY-16)
|
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY-16)
|
||||||
break;
|
break;
|
||||||
|
case 'bottom':
|
||||||
case 'below':
|
case 'below':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY+16)
|
canvas.drawVisibleText(ctx, this.text, canvasX-textSize/2, canvasY+16)
|
||||||
break;
|
break;
|
||||||
|
@ -81,15 +83,19 @@ class Text extends Common.DrawableObject {
|
||||||
case 'right':
|
case 'right':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY+4)
|
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY+4)
|
||||||
break;
|
break;
|
||||||
|
case 'top-left':
|
||||||
case 'above-left':
|
case 'above-left':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize-5, canvasY-16)
|
canvas.drawVisibleText(ctx, this.text, canvasX-textSize-5, canvasY-16)
|
||||||
break;
|
break;
|
||||||
|
case 'top-right':
|
||||||
case 'above-right':
|
case 'above-right':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY-16)
|
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY-16)
|
||||||
break;
|
break;
|
||||||
|
case 'bottom-left':
|
||||||
case 'below-left':
|
case 'below-left':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX-textSize-5, canvasY+16)
|
canvas.drawVisibleText(ctx, this.text, canvasX-textSize-5, canvasY+16)
|
||||||
break;
|
break;
|
||||||
|
case 'bottom-right':
|
||||||
case 'below-right':
|
case 'below-right':
|
||||||
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY+16)
|
canvas.drawVisibleText(ctx, this.text, canvasX+5, canvasY+16)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue