fix(编辑能力): 修正文本框缩进与组合宽度
build.yaml / build (push) Successful in 47s

This commit is contained in:
xiaoqidun committed 2026-10-28 08:19:47 +08:00
1 parent 7e3f2c468a
commit da3f64c74a
2 files changed
+9 -6

No files matched your search

+4 -1
View File
@@ -93,7 +93,7 @@ func (e *Editor) layoutRichText(value RichText, width float64) (richLayout, erro
}
options := value.Layout
available := width - options.LeftIndent - options.RightIndent
if !finite(width) || width <= 0 || !finite(available) || available <= 0 || !finite(available-options.FirstLineIndent) || available-options.FirstLineIndent <= 0 {
if !finite(width) || width <= 0 {
return richLayout{}, fmt.Errorf("invalid rich text width or indents")
}
geometry, err := e.Geometry()
@@ -156,6 +156,9 @@ func (e *Editor) layoutRichText(value RichText, width float64) (richLayout, erro
}
available = width - options.LeftIndent - options.RightIndent
}
if !finite(available) || available <= 0 || !finite(available-options.FirstLineIndent) || available-options.FirstLineIndent <= 0 {
return richLayout{}, fmt.Errorf("invalid rich text width or indents")
}
result.width = width
var underlays []GraphicObject
var shadows []GraphicObject