@ray-js/lamp-circle-picker 1.0.11-beta-3 → 1.0.11-beta-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,6 +109,10 @@ Component({
109
109
  touchCircleStrokeStyle = '',
110
110
  touchCircleLineWidth = 0
111
111
  } = this.data;
112
+ // 防止重复渲染
113
+ if (this.lastValue === value) {
114
+ return;
115
+ }
112
116
  canvasId && this.render.renderAnnulusColor(canvasId, radius, innerRingRadius, value, {
113
117
  useEventChannel,
114
118
  eventChannelName,
@@ -7,15 +7,15 @@ function reverseColorStops(colorStops) {
7
7
  return [];
8
8
  }
9
9
 
10
- const reversedColorStops = colorStops.map(stop => ({
10
+ const _reversedColorStops = colorStops.map(stop => ({
11
11
  offset: 1 - stop.offset,
12
12
  color: stop.color,
13
13
  }));
14
14
 
15
15
  // 由于反转 offset 后,需要根据新的 offset 重新排序
16
- reversedColorStops.sort((a, b) => a.offset - b.offset);
16
+ _reversedColorStops.sort((a, b) => a.offset - b.offset);
17
17
 
18
- return reversedColorStops;
18
+ return _reversedColorStops;
19
19
  }
20
20
 
21
21
  export default Render({
@@ -264,7 +264,6 @@ export default Render({
264
264
 
265
265
  // 环形色盘 降级绘制
266
266
  async renderAnnulusColorLowRank(id, radius, innerRingRadius, options = {}) {
267
- console.warn('renderAnnulusColorLowRank', JSON.stringify(options));
268
267
  let canvas = null;
269
268
  const { touchCircleStrokeStyle, ringBorderColor } =
270
269
  options;
@@ -302,15 +301,13 @@ export default Render({
302
301
  const offsetDegree = 270;
303
302
  const endDegree = startDegree + offsetDegree;
304
303
 
305
- // 颜色渲染时 按照逆时针渲染,需要按照顺时针渲染, 所以需要反转
306
- const reversedColorStops = reverseColorStops(colorList);
307
304
  this.drawRingWithConicGradient({
308
305
  startAngle: startDegree,
309
306
  endAngle: endDegree,
310
307
  offsetDegree,
311
308
  innerRadius: innerRingRadius,
312
309
  outerRadius: radius,
313
- colorList: reversedColorStops,
310
+ colorList: colorList,
314
311
  canvas,
315
312
  ctx,
316
313
  centerX: poxCenterX,
package/lib/props.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface IProps {
19
19
  * @description.en Whether to hide the drag ring
20
20
  * @default false
21
21
  */
22
- hideThumb: boolean;
22
+ hideThumb?: boolean;
23
23
  /**
24
24
  * @description.en temperature
25
25
  * @description.zh 色温
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lamp-circle-picker",
3
- "version": "1.0.11-beta-3",
3
+ "version": "1.0.11-beta-4",
4
4
  "description": "照明缺角色环",
5
5
  "main": "lib/index",
6
6
  "files": [