Skip to content

Commit 49e4008

Browse files
committed
fix(label): fix labelLine default style when normal state not show but other state show
1 parent e20d372 commit 49e4008

4 files changed

Lines changed: 134 additions & 0 deletions

File tree

src/label/labelGuideHelper.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,13 @@ export function setLabelLineStyle(
606606
const showNormal = normalModel.get('show');
607607
const labelIgnoreNormal = label.ignore;
608608

609+
// if labelLine exist and need to show in any state
610+
const needToShow = !!labelLine && !!DISPLAY_STATES.find(stateName => {
611+
const stateModel = statesModels[stateName];
612+
613+
return stateModel.get('show');
614+
});
615+
609616
for (let i = 0; i < DISPLAY_STATES.length; i++) {
610617
const stateName = DISPLAY_STATES[i];
611618
const stateModel = statesModels[stateName];
@@ -622,6 +629,11 @@ export function setLabelLineStyle(
622629
if (stateObj) {
623630
stateObj.ignore = true;
624631
}
632+
633+
// set default labelLine style
634+
if (needToShow) {
635+
setLabelLineState(labelLine, true, stateName, stateModel);
636+
}
625637
continue;
626638
}
627639
// Create labelLine if not exists

test/roseType-labeline.html

Lines changed: 120 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/runTest/actions/__meta__.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/runTest/actions/roseType-labeline.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)