refactor(editor-drawers): 减小门图标内边距计算范围,优化小尺寸区域的图标显示效果
This commit is contained in:
parent
1babdbee80
commit
f6cebf903d
@ -315,7 +315,7 @@ export function drawArea(ctx: CanvasRenderingContext2D, pen: MapPen): void {
|
||||
const deviceStatus = (pen.area as any)?.deviceStatus;
|
||||
const img = isConnected === false ? __doorImgClosed : deviceStatus === 1 ? __doorImgOpen : __doorImgClosed;
|
||||
if (img && img.complete) {
|
||||
const padding = Math.max(6, Math.min(20, Math.min(w, h) * 0.08));
|
||||
const padding = Math.max(2, Math.min(10, Math.min(w, h) * 0.02));
|
||||
const availW = Math.max(0, w - padding * 2);
|
||||
const availH = Math.max(0, h - padding * 2);
|
||||
const ratio = img.naturalWidth > 0 && img.naturalHeight > 0 ? img.naturalWidth / img.naturalHeight : 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user