feat:2.6.2 凑十法
This commit is contained in:
@@ -424,4 +424,43 @@ export class BaseDrawService {
|
||||
// 绘制内容区域分割线
|
||||
this.drawDivider();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制空白方框(边框1px,#999,无填充,不显示数字)
|
||||
*/
|
||||
drawBox(
|
||||
ctx: RenderingContext,
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
color: string = '#999',
|
||||
lineWidth: number = 1,
|
||||
) {
|
||||
// 绘制方框边框(1px,#999,无填充)
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineWidth = lineWidth;
|
||||
ctx.setLineDash([]);
|
||||
ctx.strokeRect(x, y, width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制正方形方框(调用drawBox,减少参数)
|
||||
* @param ctx 渲染上下文
|
||||
* @param x 方框左上角x
|
||||
* @param y 方框左上角y
|
||||
* @param size 方框边长
|
||||
* @param color 边框颜色(可选,默认为#999)
|
||||
* @param lineWidth 线宽(可选,默认为1)
|
||||
*/
|
||||
drawSquareBox(
|
||||
ctx: RenderingContext,
|
||||
x: number,
|
||||
y: number,
|
||||
size: number,
|
||||
color: string = '#999',
|
||||
lineWidth: number = 1,
|
||||
) {
|
||||
this.drawBox(ctx, x, y, size, size, color, lineWidth);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user