Copilot commented on code in PR #21597:
URL: https://github.com/apache/echarts/pull/21597#discussion_r3176193119
##########
src/chart/chord/ChordPiece.ts:
##########
@@ -174,15 +183,24 @@ export default class ChordPiece extends graphic.Sector {
? normalLabelModel.get('verticalAlign') || 'middle'
: (dy > 0 ? 'top' : 'bottom');
+ const labelRotate = getLabelRotation(normalLabelModel.get('rotate'),
midAngle, dx);
+
+ for (let i = 0; i < SPECIAL_STATES.length; i++) {
+ const stateName = SPECIAL_STATES[i];
+ const stateRotate =
labelStateModels[stateName].getShallow('rotate');
+ if (stateRotate != null) {
+ label.ensureState(stateName).rotation =
getLabelRotation(stateRotate, midAngle, dx);
+ }
Review Comment:
State-specific label rotations are only written when the updated model still
defines `label.rotate`. Because `ChordView` reuses `ChordPiece` instances
across `setOption` updates, an element that previously had
`emphasis/blur/select.label.rotate` keeps the old `state.rotation` forever when
that option is later removed. This leaves stale rotation in interactive updates
instead of falling back to the normal label rotation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]