@ray-js/lamp-circle-picker 1.0.13-beta-2 → 1.0.13-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.
- package/example/src/pages/index.tsx +1 -1
- package/lib/component/rjs/index.rjs +24 -12
- package/lib/index.js +2 -2
- package/package.json +1 -1
|
@@ -299,13 +299,20 @@ export default Render({
|
|
|
299
299
|
// 重置合成操作以正常绘制端点
|
|
300
300
|
ctx.globalCompositeOperation = 'source-over';
|
|
301
301
|
|
|
302
|
-
// 起始端点 -
|
|
303
|
-
//
|
|
304
|
-
const
|
|
305
|
-
const
|
|
302
|
+
// 起始端点 - 使用闭合路径绘制半圆,确保与色环无缝衔接
|
|
303
|
+
// 计算色环内外边缘的起点坐标
|
|
304
|
+
const startInnerX = centerX + innerRadius * scale * Math.cos(startAngleRad);
|
|
305
|
+
const startInnerY = centerY + innerRadius * scale * Math.sin(startAngleRad);
|
|
306
|
+
const startOuterX = centerX + outerRadius * scale * Math.cos(startAngleRad);
|
|
307
|
+
const startOuterY = centerY + outerRadius * scale * Math.sin(startAngleRad);
|
|
306
308
|
|
|
307
309
|
ctx.beginPath();
|
|
308
|
-
|
|
310
|
+
// 从内边缘开始
|
|
311
|
+
ctx.moveTo(startInnerX, startInnerY);
|
|
312
|
+
// 绘制半圆弧(从内边缘到外边缘)
|
|
313
|
+
ctx.arc(startX, startY, endpointRadius, startAngleRad, startAngleRad - Math.PI, true);
|
|
314
|
+
// 闭合路径(从外边缘回到内边缘)
|
|
315
|
+
ctx.closePath();
|
|
309
316
|
|
|
310
317
|
// 使用与色环相同的径向渐变
|
|
311
318
|
const startGradient = ctx.createRadialGradient(
|
|
@@ -321,15 +328,21 @@ export default Render({
|
|
|
321
328
|
|
|
322
329
|
ctx.fillStyle = startGradient;
|
|
323
330
|
ctx.fill();
|
|
324
|
-
ctx.closePath();
|
|
325
331
|
|
|
326
|
-
// 结束端点 -
|
|
327
|
-
//
|
|
328
|
-
const
|
|
329
|
-
const
|
|
332
|
+
// 结束端点 - 使用闭合路径绘制半圆,确保与色环无缝衔接
|
|
333
|
+
// 计算色环内外边缘的终点坐标
|
|
334
|
+
const endInnerX = centerX + innerRadius * scale * Math.cos(endAngleRad);
|
|
335
|
+
const endInnerY = centerY + innerRadius * scale * Math.sin(endAngleRad);
|
|
336
|
+
const endOuterX = centerX + outerRadius * scale * Math.cos(endAngleRad);
|
|
337
|
+
const endOuterY = centerY + outerRadius * scale * Math.sin(endAngleRad);
|
|
330
338
|
|
|
331
339
|
ctx.beginPath();
|
|
332
|
-
|
|
340
|
+
// 从内边缘开始
|
|
341
|
+
ctx.moveTo(endInnerX, endInnerY);
|
|
342
|
+
// 绘制半圆弧(从内边缘到外边缘)
|
|
343
|
+
ctx.arc(endX, endY, endpointRadius, endAngleRad, endAngleRad + Math.PI, false);
|
|
344
|
+
// 闭合路径(从外边缘回到内边缘)
|
|
345
|
+
ctx.closePath();
|
|
333
346
|
|
|
334
347
|
// 使用与色环相同的径向渐变
|
|
335
348
|
const endGradient = ctx.createRadialGradient(
|
|
@@ -345,7 +358,6 @@ export default Render({
|
|
|
345
358
|
|
|
346
359
|
ctx.fillStyle = endGradient;
|
|
347
360
|
ctx.fill();
|
|
348
|
-
ctx.closePath();
|
|
349
361
|
},
|
|
350
362
|
|
|
351
363
|
// 环形色盘 降级绘制
|
package/lib/index.js
CHANGED
|
@@ -52,9 +52,9 @@ const LampCirclePicker = props => {
|
|
|
52
52
|
return /*#__PURE__*/React.createElement(View, {
|
|
53
53
|
className: clsx(styled.container, styled.flexCenter),
|
|
54
54
|
style: style
|
|
55
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
56
|
-
className: clsx(styled.innerBox, styled.flexCenter)
|
|
57
55
|
}, showInnerCircle && /*#__PURE__*/React.createElement(View, {
|
|
56
|
+
className: clsx(styled.innerBox, styled.flexCenter)
|
|
57
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
58
58
|
className: styled.ringIcon,
|
|
59
59
|
style: {
|
|
60
60
|
width: innerImgRadius,
|