Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/component/visualMap/ContinuousView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class ContinuousView extends VisualMapView {

// Bar
gradientBarGroup.add(shapes.outOfRange = createPolygon());
shapes.outOfRange.setClipPath(new graphic.Polygon());
gradientBarGroup.add(shapes.inRange = createPolygon(
null,
useHandle ? getCursor(this._orient) : null
Expand Down Expand Up @@ -511,6 +512,16 @@ class ContinuousView extends VisualMapView {
})
.setShape('points', visualOutOfRange.barPoints);

// Keep the out-of-range gradient and geometry intact, but do not draw
// it underneath the selected area, where translucent colors would mix.
const inPoints = visualInRange.barPoints;
const width = visualMapModel.itemSize[0];
const height = visualMapModel.itemSize[1];
(shapes.outOfRange.getClipPath() as graphic.Polygon).setShape('points', [
[0, 0], [width, 0], [width, inPoints[0][1]], inPoints[0], inPoints[3],
[width, inPoints[3][1]], [width, height], [0, height]
]);

this._updateHandle(inRangeHandleEnds, visualInRange);
}

Expand Down
79 changes: 79 additions & 0 deletions test/ut/spec/component/visualMap/continuousGradient.test.ts

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