Skip to content

Commit

Permalink
Merge pull request #18808 from linghaoSu/fix/sunburst-rotate-label
Browse files Browse the repository at this point in the history
fix(sunburst): normalize label rotation when decompress from matrix
  • Loading branch information
Ovilia committed Jun 27, 2023
2 parents b0c8338 + e7ad886 commit 0ddf9f7
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/chart/sunburst/SunburstPiece.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class SunburstPiece extends graphic.Sector {
rotate = rotateType * Math.PI / 180;
}

state.rotation = rotate;
state.rotation = normalizeRadian(rotate);
});


Expand Down
3 changes: 3 additions & 0 deletions src/label/LabelManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { PathStyleProps } from 'zrender/src/graphic/Path';
import Model from '../model/Model';
import { prepareLayoutList, hideOverlap, shiftLayoutOnX, shiftLayoutOnY } from './labelLayoutHelper';
import { labelInner, animateLabelValue } from './labelStyle';
import { normalizeRadian } from 'zrender/src/contain/util';

interface LabelDesc {
label: ZRText
Expand Down Expand Up @@ -219,6 +220,8 @@ class LabelManager {
dummyTransformable.scaleX = dummyTransformable.scaleY = 1;
}

dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);

const host = label.__hostTarget;
let hostRect;
if (host) {
Expand Down
1 change: 1 addition & 0 deletions test/runTest/actions/__meta__.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/runTest/actions/sunburst-label-rotate.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 110 additions & 0 deletions test/sunburst-label-rotate.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ddf9f7

Please sign in to comment.