MCPcopy
hub / github.com/g3n/engine / AttribCheckBorderSizes

Function AttribCheckBorderSizes

gui/builder.go:939–954  ·  view source on GitHub ↗

AttribCheckBorderSizes checks and convert attribute with border sizes

(b *Builder, am map[string]interface{}, fname string)

Source from the content-addressed store, hash-verified

937
938// AttribCheckBorderSizes checks and convert attribute with border sizes
939func AttribCheckBorderSizes(b *Builder, am map[string]interface{}, fname string) error {
940
941 va, err := b.parseFloats(am, fname, 1, 4)
942 if err != nil {
943 return err
944 }
945 if va == nil {
946 return nil
947 }
948 if len(va) == 1 {
949 am[fname] = &RectBounds{va[0], va[0], va[0], va[0]}
950 return nil
951 }
952 am[fname] = &RectBounds{va[0], va[1], va[2], va[3]}
953 return nil
954}
955
956// AttribCheckPosition checks and convert attribute with x and y position
957func AttribCheckPosition(b *Builder, am map[string]interface{}, fname string) error {

Callers

nothing calls this directly

Calls 1

parseFloatsMethod · 0.80

Tested by

no test coverage detected