MCPcopy Index your code
hub / github.com/g3n/engine / AttribCheckLayout

Function AttribCheckLayout

gui/builder.go:721–740  ·  view source on GitHub ↗

AttribCheckLayout checks and converts layout attribute

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

Source from the content-addressed store, hash-verified

719
720// AttribCheckLayout checks and converts layout attribute
721func AttribCheckLayout(b *Builder, am map[string]interface{}, fname string) error {
722
723 v := am[fname]
724 if v == nil {
725 return nil
726 }
727 msi, ok := v.(map[string]interface{})
728 if !ok {
729 return b.err(am, fname, "Not a map")
730 }
731 lti := msi[AttribType]
732 if lti == nil {
733 return b.err(am, fname, "Layout must have a type")
734 }
735 lfunc := b.layouts[lti.(string)]
736 if lfunc == nil {
737 return b.err(am, fname, "Invalid layout type")
738 }
739 return nil
740}
741
742// AttribCheckAlign checks and converts layout align* attribute
743func AttribCheckAlign(b *Builder, am map[string]interface{}, fname string) error {

Callers

nothing calls this directly

Calls 1

errMethod · 0.80

Tested by

no test coverage detected