Move text out of state circle when too long
This commit is contained in:
parent
6f16c5c9b7
commit
186c28c8e7
|
@ -58,7 +58,11 @@ class State {
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.fillStyle = settings.colors.getColor(this);
|
ctx.fillStyle = settings.colors.getColor(this);
|
||||||
ctx.drawText(this.text, this.x, this.y, null, selectedObject === this);
|
const width = ctx.measureText(this.text).width;
|
||||||
|
if(width < radius * .9)
|
||||||
|
ctx.drawText(this.text, this.x, this.y, null, selectedObject === this);
|
||||||
|
else
|
||||||
|
ctx.drawText(this.text, this.x, this.y + radius * 1.75, null, selectedObject === this);
|
||||||
|
|
||||||
if(this.isAcceptState) {
|
if(this.isAcceptState) {
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user