fix(B07-CAD): 커서 입력창 글이 칸 안 — 줄 세로 가운데 · 칸 폭 = 가장 긴 줄 · 후보 목록도 바탕 안(97-2)
- 글 중심 = 줄 세로 가운데(옛 칸 아래 변 2px 밑) - 칸 폭 = max(150, 가장 긴 줄 글 폭 + 여백 8) · measureTextScreen(measureText 감쌈) - 안내 · 좌표 · 명령 후보(최대 6줄)도 바탕 한 장 안 · 입력 줄 아래 가는 줄 - 그리기 시험: 글 중심 · 12px 글 전체가 칸 안 · 폭 · 최소 폭 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KYZ2HWWdUwZWYnn3tQz7X
This commit is contained in:
@@ -525,6 +525,15 @@ export class ScreenCanvasDrawController implements DrawController {
|
||||
});
|
||||
}
|
||||
|
||||
/** 화면 글 폭(px) — drawTextScreen 과 같은 글꼴로 잼 */
|
||||
public measureTextScreen(label: string, fontSize: number): number {
|
||||
this.context.save();
|
||||
this.context.font = `${fontSize}px ${DEFAULT_TEXT_OPTIONS.fontFamily}`;
|
||||
const width = this.context.measureText(label).width;
|
||||
this.context.restore();
|
||||
return width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw some text at the base location
|
||||
* The direction vector points from the bottom of the first letter towards the bottom of the last letter indicate the rotation of the text
|
||||
|
||||
Reference in New Issue
Block a user