feat:2.5.6 广告组件优化
This commit is contained in:
@@ -368,6 +368,12 @@ export class BaseDrawService {
|
||||
|
||||
/**
|
||||
* 绘制圆点
|
||||
* @param ctx 绘制上下文
|
||||
* @param x 圆点中心X坐标
|
||||
* @param y 圆点中心Y坐标
|
||||
* @param radius 圆点半径
|
||||
* @param fillColor 填充颜色,默认为 '#93D333'
|
||||
* @param strokeColor 边线颜色,如果传入则绘制边线,宽度为1,默认不绘制
|
||||
*/
|
||||
drawDot(
|
||||
ctx: RenderingContext,
|
||||
@@ -375,10 +381,20 @@ export class BaseDrawService {
|
||||
y: number,
|
||||
radius: number,
|
||||
fillColor?: string,
|
||||
strokeColor?: string,
|
||||
) {
|
||||
ctx.fillStyle = fillColor ?? '#93D333';
|
||||
ctx.beginPath();
|
||||
ctx.arc(x, y, radius, 0, Math.PI * 2);
|
||||
|
||||
// 绘制填充
|
||||
ctx.fillStyle = fillColor ?? '#93D333';
|
||||
ctx.fill();
|
||||
|
||||
// 绘制边线(如果提供了边线颜色)
|
||||
if (strokeColor) {
|
||||
ctx.strokeStyle = strokeColor;
|
||||
ctx.lineWidth = 1;
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user