canvas

package
v0.0.0-...-71c6e05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	X, Y, X2, Y2 *float64
	Parent       *string
	// contains filtered or unexported fields
}

Entry represents an entry in the 'canvas' section

func NewEntry

func NewEntry() (e Entry)

NewEntry returns a new canvas entry

func (*Entry) ID

func (e *Entry) ID() string

ID returns the ID of this entry

type Store

type Store map[string]*Entry

Store stores a set of preset entries

func NewStore

func NewStore() (s Store)

NewStore creates a new store.

func (*Store) Add

func (s *Store) Add(id string, e *Entry)

Add adds an entry to the store and also sets the ID on the entry

func (*Store) AddCanvasesToStamp

func (s *Store) AddCanvasesToStamp(stamp *stamp.Stamp)

AddCanvasesToStamp adds all included canvases to the provided stamp.

func (Store) Get

func (s Store) Get(id string) (e *Entry, exists bool)

Get returns the Entry matching the provided id.

func (*Store) InheritFrom

func (s *Store) InheritFrom(other Store)

InheritFrom copies over entries from another Store that do not yet exist in the current Store.

func (*Store) IsValid

func (s *Store) IsValid() (err error)

IsValid validates whether all contained entries are valid. This should only be called after the store was resolved.

func (*Store) Resolve

func (s *Store) Resolve() (err error)

Resolve resolves inherited values between presets

func (*Store) UnmarshalYAML

func (s *Store) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

UnmarshalYAML unmarshals a canvas Store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL