Skip to content

Commit

Permalink
fix(legend): inherit legend rich text color from legend's options. close
Browse files Browse the repository at this point in the history
  • Loading branch information
ChepteaCatalin authored and chepteac committed Feb 12, 2023
1 parent 8120aab commit 24c01c1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/component/legend/LegendView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,18 @@ class LegendView extends ComponentView {
content = formatter(name);
}

const inactiveColor = legendItemModel.get('inactiveColor');
const textColor = isSelected
? textStyleModel.getTextColor() : legendItemModel.get('inactiveColor');

itemGroup.add(new graphic.Text({
style: createTextStyle(textStyleModel, {
text: content,
x: textX,
y: itemHeight / 2,
fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,
fill: textColor,
align: textAlign,
verticalAlign: 'middle'
})
}, {inheritColor: textColor})
}));

// Add a invisible rect to increase the area of mouse hover
Expand Down

0 comments on commit 24c01c1

Please sign in to comment.