diff --git a/src/label/LabelManager.ts b/src/label/LabelManager.ts index d02ffb6772..cce12b4202 100644 --- a/src/label/LabelManager.ts +++ b/src/label/LabelManager.ts @@ -364,6 +364,7 @@ class LabelManager { needsUpdateLabelLine = true; } else { + label.x = defaultLabelAttr.x; label.setStyle('x', defaultLabelAttr.style.x); } @@ -373,6 +374,7 @@ class LabelManager { needsUpdateLabelLine = true; } else { + label.y = defaultLabelAttr.y; label.setStyle('y', defaultLabelAttr.style.y); } @@ -393,16 +395,10 @@ class LabelManager { if (layoutOption.x != null) { labelState.x = parsePercent(layoutOption.x, width); } - else if (isNormal) { - labelState.x = defaultLabelAttr.x; - } if (layoutOption.y != null) { labelState.y = parsePercent(layoutOption.y, height); } - else if (isNormal) { - labelState.y = defaultLabelAttr.y; - } if (layoutOption.align != null) { labelState.style = labelState.style || {};