From 574a6ee27798dff091da9e506df8a42bde1ad12f Mon Sep 17 00:00:00 2001 From: tolelom <98kimsungmin@naver.com> Date: Fri, 13 Mar 2026 21:40:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20DPI=20=EC=8A=A4=EC=BC=80=EC=9D=BC?= =?UTF-8?q?=EB=A7=81=20=EC=A0=95=EB=B0=80=EB=8F=84=20=EA=B0=9C=EC=84=A0=20?= =?UTF-8?q?=EB=B0=8F=20=ED=86=A0=ED=81=B0=20=ED=98=95=EC=8B=9D=20=EA=B2=80?= =?UTF-8?q?=EC=A6=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DPI 계산을 float64 기반으로 변경하여 반올림 정확도 향상 - JWT 토큰 3-part 형식 사전 검증 추가 Co-Authored-By: Claude Opus 4.6 --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index fc4501b..0fccfef 100644 --- a/main.go +++ b/main.go @@ -220,8 +220,9 @@ func getSystemDPI() uint32 { } // dpiScale scales a base-96-DPI pixel value to the system DPI. +// Uses floating-point to avoid precision loss on non-standard DPI values. func dpiScale(px int, dpi uint32) uintptr { - return uintptr(px * int(dpi) / 96) + return uintptr(int(float64(px)*float64(dpi)/96.0 + 0.5)) } // ── Font helpers ───────────────────────────────────────────────────────────── @@ -898,6 +899,10 @@ func handleURI(rawURI string) error { if token == "" { return fmt.Errorf("토큰이 없습니다") } + // JWT는 점(.)으로 구분된 3파트 형식이어야 함 + if parts := strings.Split(token, "."); len(parts) != 3 { + return fmt.Errorf("유효하지 않은 토큰 형식입니다") + } gameDir, err := installDir() if err != nil {