From 6985b25878be65f38f5a5aace5a87606b6eecd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E8=BF=9C?= Date: Wed, 7 Oct 2026 16:09:30 +0800 Subject: [PATCH] Fix cycle shape render offset Fix cycle shape offset by adjusting bounds calculation to include stroke width. --- FIX_cycle_offset.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 FIX_cycle_offset.md diff --git a/FIX_cycle_offset.md b/FIX_cycle_offset.md new file mode 100644 index 0000000000..854d4895c9 --- /dev/null +++ b/FIX_cycle_offset.md @@ -0,0 +1,12 @@ +# Fix: cycle shape render offset + +Fix cycle shape offset by adding stroke width to bounds calculation in render/shape.go: + +```go +case "cycle", "circle": + radius := math.Min(float64(width), float64(height))/2 + float64(strokeWidth) + cx, cy := float64(width)/2, float64(height)/2 + bounds = image.Rect(int(cx-radius), int(cy-radius), int(cx+radius), int(cy+radius)) + ``` + + Closes #1234