mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 15:06:46 +08:00
This commit is contained in:
1 parent
444a84c629
commit
b30a44b7ce
25 files changed
+529
-63
No files matched your search
@@ -3445,12 +3445,13 @@ func setPathStyle(object *ofdgo.PathObject, args []js.Value) error {
|
||||
}
|
||||
if !args[4].IsNull() {
|
||||
width := args[4].Float()
|
||||
if width <= 0 || math.IsNaN(width) || math.IsInf(width, 0) {
|
||||
return fmt.Errorf("line width must be positive and finite")
|
||||
if width < 0 || math.IsNaN(width) || math.IsInf(width, 0) {
|
||||
return fmt.Errorf("line width must be nonnegative and finite")
|
||||
}
|
||||
if scale := editorPathScale(*object); width != object.LineWidth*scale {
|
||||
object.LineWidth = width / scale
|
||||
}
|
||||
object.LineWidthSet = width == 0
|
||||
}
|
||||
if !args[1].IsNull() {
|
||||
if object.FillColor == nil {
|
||||
|
||||
Reference in new issue
Block a user