@ray-js/lamp-circle-picker 1.0.6 → 1.0.7-beta-1

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.
@@ -66,6 +66,7 @@ export default Render({
66
66
  this.canvasThumb = await getCanvasById(`${id}_thumb`);
67
67
  this.canvasThumbCtx = this.canvasThumb.getContext('2d');
68
68
  }
69
+ this.removeEventListeners();
69
70
  this.addEventListeners();
70
71
  this._getAnglePositionByValue(temp);
71
72
  },
@@ -177,14 +178,13 @@ export default Render({
177
178
  return { x: thumbPositionX, y: thumbPositionY };
178
179
  }
179
180
  if (angle > 115 && angle <= 135) {
181
+ // 修正在范围外的点击区域导致的取色问题
182
+ const _angle = 135;
183
+ const realAngle = ((180 - _angle) / 180) * Math.PI;
180
184
  const thumbPositionY =
181
- radius +
182
- (innerRingRadius + (radius - innerRingRadius) / 2) *
183
- Math.sin(Math.atan2(210 - radius, 70 - radius));
185
+ radius + (innerRingRadius + (radius - innerRingRadius) / 2) * Math.sin(realAngle);
184
186
  const thumbPositionX =
185
- radius +
186
- (innerRingRadius + (radius - innerRingRadius) / 2) *
187
- Math.cos(Math.atan2(210 - radius, 70 - radius));
187
+ radius - (innerRingRadius + (radius - innerRingRadius) / 2) * Math.cos(realAngle);
188
188
  return { x: thumbPositionX, y: thumbPositionY };
189
189
  }
190
190
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lamp-circle-picker",
3
- "version": "1.0.6",
3
+ "version": "1.0.7-beta-1",
4
4
  "description": "照明缺角色环",
5
5
  "main": "lib/index",
6
6
  "files": [