fix(server): widen letter-spacing normalization bounds to ±256

Negative and larger letter spacing values are legitimate for extracted
text layers; clamp only outside ±256 instead of rejecting anything
below 0 (or above 80 in the extractor).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 12:26:08 +08:00
parent 906846a717
commit 568690e2f1
2 changed files with 2 additions and 2 deletions
@@ -6059,7 +6059,7 @@ func newEditableTextLayers(target design.Node, extraction design.TextExtraction)
lineHeight = 1.08 lineHeight = 1.08
} }
letterSpacing := layer.LetterSpacing letterSpacing := layer.LetterSpacing
if letterSpacing < 0 { if letterSpacing < -256 || letterSpacing > 256 {
letterSpacing = 0 letterSpacing = 0
} }
strokeColor := strings.TrimSpace(layer.StrokeColor) strokeColor := strings.TrimSpace(layer.StrokeColor)
@@ -353,7 +353,7 @@ func normalizeLineHeight(value float64, fontSize float64) float64 {
} }
func normalizeLetterSpacing(value float64) float64 { func normalizeLetterSpacing(value float64) float64 {
if value < 0 || value > 80 { if value < -256 || value > 256 {
return 0 return 0
} }
return value return value