|
|
@ -4,6 +4,7 @@ class Label { |
|
|
|
constructor(body,options) { |
|
|
|
this.body = body; |
|
|
|
|
|
|
|
this.pointToSelf = false; |
|
|
|
this.baseSize = undefined; |
|
|
|
this.setOptions(options); |
|
|
|
this.size = {top: 0, left: 0, width: 0, height: 0, yLine: 0}; // could be cached
|
|
|
@ -143,7 +144,7 @@ class Label { |
|
|
|
_setAlignment(ctx, x, yLine, baseline) { |
|
|
|
// check for label alignment (for edges)
|
|
|
|
// TODO: make alignment for nodes
|
|
|
|
if (this.options.font.align !== 'horizontal') { |
|
|
|
if (this.options.font.align !== 'horizontal' && this.pointToSelf === false) { |
|
|
|
x = 0; |
|
|
|
yLine = 0; |
|
|
|
|
|
|
|