mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 14:53:44 +08:00
1 parent
7e3f2c468a
commit
da3f64c74a
2 files changed
+9
-6
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user