diff --git a/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts b/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts index c4d6d3722..e0c14b613 100644 --- a/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts +++ b/packages/lb-annotation/src/core/toolOperation/ViewOperation.ts @@ -640,8 +640,13 @@ export default class ViewOperation extends BasicToolOperation { const size = { width: this.imgNode.width, height: this.imgNode.height }; const { ctx, canvas: offsetCanvas } = CanvasUtils.createCanvas(size); if (ctx && data?.length > 0) { - // 1. - DrawUtils.drawPixel({ canvas: offsetCanvas, points: data, size, defaultRGBA: annotation.defaultRGBA }); + DrawUtils.drawPixel({ + canvas: offsetCanvas, + points: data, + size, + defaultRGBA: annotation.defaultRGBA, + pixelSize: 13, + }); DrawUtils.drawImg(this.canvas, offsetCanvas, { zoom: this.zoom, currentPos: this.currentPos, diff --git a/packages/lb-annotation/src/utils/tool/DrawUtils.ts b/packages/lb-annotation/src/utils/tool/DrawUtils.ts index 860d77200..377a49936 100644 --- a/packages/lb-annotation/src/utils/tool/DrawUtils.ts +++ b/packages/lb-annotation/src/utils/tool/DrawUtils.ts @@ -851,11 +851,13 @@ export default class DrawUtils { points, size, defaultRGBA, + pixelSize = 13, }: { canvas: HTMLCanvasElement; points: IPixelPoints[]; size: ISize; defaultRGBA?: string; + pixelSize?: number; }) { const ctx = canvas.getContext('2d')!; const { width, height } = size; @@ -868,10 +870,7 @@ export default class DrawUtils { imageData.data[baseIndex + 3] = Math.floor(255 * alpha); }; - const maxSize = Math.max(width, height); - const pixelSize = Math.floor(Math.pow(MathUtils.calculateThousandsPlace(maxSize), 2)); const offsetArr = MathUtils.generateCoordinates(pixelSize); - points.forEach((item) => { for (const [x, y] of offsetArr) { const baseIndex = (item.y + y) * (imageData.width * 4) + (item.x + x) * 4;