This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch feat/datazoom/move-hanlde/border-radius
in repository https://gitbox.apache.org/repos/asf/echarts.git
The following commit(s) were added to
refs/heads/feat/datazoom/move-hanlde/border-radius by this push:
new 7edbe941b fix(dataZoom): fix c3698128b4bef94db0233dafeaf025e9ce5ef7e5
- only add borderRadius for the shadow segment at the both ends.
7edbe941b is described below
commit 7edbe941b806cde330fcf083f293f78ace6c6862
Author: plainheart <[email protected]>
AuthorDate: Fri Aug 4 12:58:45 2023 +0800
fix(dataZoom): fix c3698128b4bef94db0233dafeaf025e9ce5ef7e5 - only add
borderRadius for the shadow segment at the both ends.
---
src/component/dataZoom/SliderZoomView.ts | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/component/dataZoom/SliderZoomView.ts
b/src/component/dataZoom/SliderZoomView.ts
index 7424b36cd..5eaf2c186 100644
--- a/src/component/dataZoom/SliderZoomView.ts
+++ b/src/component/dataZoom/SliderZoomView.ts
@@ -43,6 +43,7 @@ import { PointLike } from 'zrender/src/core/Point';
import Displayable from 'zrender/src/graphic/Displayable';
import {createTextStyle} from '../../label/labelStyle';
import SeriesData from '../../data/SeriesData';
+import { normalizeCssArray } from '../../util/format';
const Rect = graphic.Rect;
@@ -785,9 +786,11 @@ class SliderZoomView extends DataZoomView {
const dataShadowSegs = displaybles.dataShadowSegs;
const segIntervals = [0, handleInterval[0], handleInterval[1],
size[0]];
- for (let i = 0; i < dataShadowSegs.length; i++) {
+ const borderRadius =
normalizeCssArray(this.dataZoomModel.get('borderRadius') || 0);
+ const segNum = dataShadowSegs.length;
+ for (let i = 0; i < segNum; i++) {
const segGroup = dataShadowSegs[i];
- let clipPath = segGroup.getClipPath();
+ let clipPath = segGroup.getClipPath() as graphic.Rect;
if (!clipPath) {
clipPath = new graphic.Rect();
segGroup.setClipPath(clipPath);
@@ -796,10 +799,14 @@ class SliderZoomView extends DataZoomView {
x: segIntervals[i],
y: 0,
width: segIntervals[i + 1] - segIntervals[i],
- height: size[1],
- // prevent shadow from overflow when `borderRadius` is set
- r: this.dataZoomModel.get('borderRadius') || 0
+ height: size[1]
});
+ // prevent shadow from overflow when `borderRadius` is set
+ if (i === 0 || i === segNum - 1) {
+ clipPath.shape.r = i === 0
+ ? [borderRadius[0], 0, 0, borderRadius[3]]
+ : [0, borderRadius[1], borderRadius[2], 0];
+ }
}
this._updateDataInfo(nonRealtime);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]