fix: 修改描述区字体大小计算逻辑,确保在极小区域下仍能正常渲染文本

This commit is contained in:
xudan 2025-08-12 17:55:59 +08:00
parent 8e6b317348
commit bdaa6b2b21

View File

@ -1471,7 +1471,7 @@ function drawArea(ctx: CanvasRenderingContext2D, pen: MapPen): void {
let descFontSize = Math.min(w / 6, h / 4, 200);
let lines: string[] = [];
while (descFontSize > 8) {
while (descFontSize > 1) {
ctx.font = `${descFontSize}px ${fontFamily}`;
const maxCharsPerLine = Math.floor(w / (descFontSize * 0.8));