vector

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: BSD-3-Clause Imports: 41 Imported by: 0

README

alt tag

Grid is a Cogent Core based SVG vector drawing program, with design based on Inkscape.

If an acronym is required, how about: "Go-rendered interactive drawing" program.

Behavior

  • multiple select actions keep doing down even inside groups, so it is easy to operate inside groups but group is the "default"

  • Alt on control knobs -> rotate instead of clicking again to get rotation knobs -- this is compatible with above and better :)

Install

The simple Go install command should work, for modules mode:

$ go install cogentcore.org/cogent/vector/cmd/vector@main

Exporting PNG and PDF depends on https://inkscape.org -- on the Mac you need to make a link to /usr/local/bin and likewise for Linux:

$ sudo ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape /usr/local/bin/

Design

Similar to inkscape in overall layout, and read / write inkscape compatible SVG files.

  • Main horiz toolbar(s) across top -- top one is static, bottom one is dynamic based on selection / tool mode.

  • Left vert toolbar with drawing tools

  • Left panel with drawing structure. This is just like GiEditor tree -- provides direct access as needed. In particular this provides layer-level organization -- always have a layer group by default, and can drag items into different layers, and also have view and freeze flags on layers. usu only show layer level, and selection there determines which layer things are added to!

  • Main middle panel with drawing. Grid underlay is a separate image that is drawn first, updated with any changes.

  • Right tab panel with all the controls, just like gide in terms of tab & Inkscape overall. tabs are easier to find vs. inkscape.

  • code in main grid package provides all the editors for right tabs.

Status

Basic functionality now in place:

  • create: rect, ellipse, line, text, import image

  • full basic paint settings (gradients, markers, etc), and text properties, editing

  • dynamic guide alignment, Align panel

  • basic node editor -- can move the main points, not the extra control points

  • full undo / redo for everything.

  • Preferences

TODO:

  • double-click on text brings up text bar and text panel

  • add more layer logic -- if layers, everything should be in a layer?

  • import svg -- same as marker

  • add group / ungroup to context menu (conditional on selection n etc)

  • implement the full transform panel

  • render gradient icons

  • show selected path node in diff color.. red? node sel map

  • rest of line properties -- easy

  • dropper = grab style from containsnode, apply to selection -- don't affect selection!

  • svg.Node ToPath -- convert any node to a path

  • node editor -- big job but needed for making basic bezier curves..

  • esc aborts new el drag

  • add distribute to Align

  • svg.Text align Center, etc affects different tspans within overall text block

  • Text edit panel -- finish toolbar

  • cut / paste not updating tree reliably. more tree update debugging fun!

  • use grid itself to render all new icons!

  • figure out mask clipping eventually.

Inkscape special flags

https://wiki.inkscape.org/wiki/index.php/Inkscape_SVG_vs._plain_SVG

Documentation

Overview

Package vector implements a 2D vector graphics program.

Index

Constants

This section is empty.

Variables

View Source
var (
	HandleSpriteScale = float32(18)
	HandleSizeMin     = 4
	HandleBorderMin   = 2
)
View Source
var (
	LineSpriteScale = float32(8)
	LineSizeMin     = 3
	LineBorderMin   = 1
)
View Source
var ActionHelpMap = map[string]string{
	"Move":    "<b>Alt</b> = move without snapping, <b>Ctrl</b> = constrain to axis with smallest delta",
	"Reshape": "<b>Alt</b> = rotate, <b>Ctrl</b> = constraint to axis with smallest delta",
}

ActionHelpMap contains a set of help strings for different actions which are the names given e.g., in the ActStart, SaveUndo etc.

View Source
var AlignViewType = types.AddType(&types.Type{Name: "cogentcore.org/cogent/vector.AlignView", IDName: "align-view", Doc: "AlignView provides a range of alignment actions on selected objects.", Embeds: []types.Field{{Name: "Layout"}}, Fields: []types.Field{{Name: "AlignAnchorView"}, {Name: "VectorView", Doc: "the parent vectorview"}}, Instance: &AlignView{}})

AlignViewType is the types.Type for AlignView

View Source
var AllDashIconNames []icons.Icon

AllDashIconNames contains all of the available dash names as IconNames -- for chooser.

View Source
var AllDashNames []string

AllDashNames contains all of the available dash names. it is initialized from StdDashNames.

View Source
var AllDashesMap map[string][]float64

AllDashesMap contains all of the available Dashes. it is initialized from StdDashesMap

View Source
var AllMarkerIconNames []icons.Icon

AllMarkerIconNames contains all of the available marker names as IconNames -- for chooser. All names have marker- prefix in addition to regular marker names.

View Source
var AllMarkerNames []string

AllMarkerNames contains all of the available marker names. it is initialized from StdMarkerNames.

View Source
var AllMarkersSVGMap map[string]*svg.Marker

AllMarkersSVGMap contains all of the available Markers as *svg.Marker elements that have been converted from the XML source.

View Source
var AllMarkersXMLMap map[string]string

AllMarkersXMLMap contains all of the available Markers as XML source. It is initialized from StdMarkersMap

View Source
var AvailableSplitNames []string

AvailableSplitNames are the names of the current AvailableSplits -- used for some choosers

View Source
var AvailableSplitsChanged = false

AvailableSplitsChanged is used to update toolbars via following menu, toolbar properties update methods -- not accurate if editing any other map but works for now..

View Source
var DashIconsInited = false

DashIconsInited records whether the dashes have been initialized into Icons for use in selectors: see DashIconsInit()

View Source
var Icons embed.FS

Icons contains all of the Vector icons.

View Source
var MarkerIconsInited = false

MarkerIconsInited records whether the dashes have been initialized into Icons for use in selectors: see MarkerIconsInit()

View Source
var PaintViewType = types.AddType(&types.Type{Name: "cogentcore.org/cogent/vector.PaintView", IDName: "paint-view", Doc: "PaintView provides editing of basic Stroke and Fill painting parameters\nfor selected items", Embeds: []types.Field{{Name: "Layout"}}, Fields: []types.Field{{Name: "StrokeType", Doc: "paint type for stroke"}, {Name: "StrokeStops", Doc: "name of gradient with stops"}, {Name: "FillType", Doc: "paint type for fill"}, {Name: "FillStops", Doc: "name of gradient with stops"}, {Name: "VectorView", Doc: "the parent vectorview"}}, Instance: &PaintView{}})

PaintViewType is the types.Type for PaintView

View Source
var SVGViewType = types.AddType(&types.Type{Name: "cogentcore.org/cogent/vector.SVGView", IDName: "svg-view", Doc: "SVGView is the element for viewing, interacting with the SVG", Embeds: []types.Field{{Name: "SVG"}}, Fields: []types.Field{{Name: "VectorView", Doc: "the parent vectorview"}, {Name: "Trans", Doc: "view translation offset (from dragging)"}, {Name: "Scale", Doc: "view scaling (from zooming)"}, {Name: "Grid", Doc: "grid spacing, in native ViewBox units"}, {Name: "VectorEff", Doc: "effective grid spacing given Scale level"}, {Name: "BgPixels", Doc: "background pixels, includes page outline and grid"}, {Name: "bgTrans", Doc: "bg rendered translation"}, {Name: "bgScale", Doc: "bg rendered scale"}, {Name: "bgVectorEff", Doc: "bg rendered grid"}}, Instance: &SVGView{}})

SVGViewType is the types.Type for SVGView

View Source
var Settings = Preferences{}

Settings are the overall Vector preferences

View Source
var SettingsFileName = "grid_prefs.json"

SettingsFileName is the name of the preferences file in app settings directory

View Source
var SplitsSettingsFilename = "splits-settings.json"

SplitsSettingsFilename is the name of the settings file in App prefs directory for saving / loading the default AvailSplits

View Source
var SpriteNames = map[Sprites]string{
	SpBBoxUpL: "up-l",
	SpBBoxUpC: "up-c",
	SpBBoxUpR: "up-r",
	SpBBoxDnL: "dn-l",
	SpBBoxDnC: "dn-c",
	SpBBoxDnR: "dn-r",
	SpBBoxLfM: "lf-m",
	SpBBoxRtM: "rt-m",

	SpReshapeBBox: "reshape-bbox",

	SpSelBBox: "sel-bbox",

	SpNodePoint: "node-point",
	SpNodeCtrl:  "node-ctrl",

	SpRubberBand: "rubber-band",

	SpAlignMatch: "align-match",
}

SpriteNames are name strings to use for naming sprites

View Source
var StandardDashNames = []string{
	"dash-solid",
	"dash-1-1",
	"dash-1-2",
	"dash-1-3",
	"dash-1-4",
	"dash-1-6",
	"dash-1-8",
	"dash-1-12",
	"dash-1-24",
	"dash-1-48",
	"dash-empty",
	"dash-2-1",
	"dash-3-1",
	"dash-4-1",
	"dash-6-1",
	"dash-8-1",
	"dash-12-1",
	"dash-24-1",
	"dash-2-2",
	"dash-3-3",
	"dash-4-4",
	"dash-6-6",
	"dash-8-8",
	"dash-12-12",
	"dash-24-24",
	"dash-2-4",
	"dash-4-2",
	"dash-2-6",
	"dash-6-2",
	"dash-4-8",
	"dash-8-4",
	"dash-2-1-012-1",
	"dash-4-2-1-2",
	"dash-8-2-1-2",
	"dash-012-012",
	"dash-014-014",
	"dash-0110-0110",
}

StandardDashNames are standard dash patterns

View Source
var StandardDashesMap = map[string][]float64{
	"dash-solid":     {},
	"dash-1-1":       {1, 1},
	"dash-1-2":       {1, 2},
	"dash-1-3":       {1, 3},
	"dash-1-4":       {1, 4},
	"dash-1-6":       {1, 6},
	"dash-1-8":       {1, 8},
	"dash-1-12":      {1, 12},
	"dash-1-24":      {1, 24},
	"dash-1-48":      {1, 48},
	"dash-empty":     {0, 11},
	"dash-2-1":       {2, 1},
	"dash-3-1":       {3, 1},
	"dash-4-1":       {4, 1},
	"dash-6-1":       {6, 1},
	"dash-8-1":       {8, 1},
	"dash-12-1":      {12, 1},
	"dash-24-1":      {24, 1},
	"dash-2-2":       {2, 2},
	"dash-3-3":       {3, 3},
	"dash-4-4":       {4, 4},
	"dash-6-6":       {6, 6},
	"dash-8-8":       {8, 8},
	"dash-12-12":     {12, 12},
	"dash-24-24":     {24, 24},
	"dash-2-4":       {2, 4},
	"dash-4-2":       {4, 2},
	"dash-2-6":       {2, 6},
	"dash-6-2":       {6, 2},
	"dash-4-8":       {4, 8},
	"dash-8-4":       {8, 4},
	"dash-2-1-012-1": {2, 1, 0.5, 1},
	"dash-4-2-1-2":   {4, 2, 1, 2},
	"dash-8-2-1-2":   {8, 2, 1, 2},
	"dash-012-012":   {0.5, 0.5},
	"dash-014-014":   {0.25, 0.25},
	"dash-0110-0110": {0.1, 0.1},
}

StandardDashesMap are standard dash patterns

View Source
var StandardMarkerNames = []string{
	"-",

	"Arrow1Sstart",
	"Arrow1Send",
	"Arrow1Mstart",
	"Arrow1Mend",
	"Arrow1Lstart",
	"Arrow1Lend",

	"Arrow2Sstart",
	"Arrow2Send",
	"Arrow2Mstart",
	"Arrow2Mend",
	"Arrow2Lstart",
	"Arrow2Lend",

	"Tail",

	"DistanceStart",
	"DistanceEnd",

	"DotS",
	"DotM",
	"DotL",

	"SquareS",
	"SquareM",
	"SquareL",

	"DiamondS",
	"DiamondM",
	"DiamondL",

	"DiamondSstart",
	"DiamondSend",
	"DiamondMstart",
	"DiamondMend",
	"DiamondLstart",
	"DiamondLend",

	"EmptyDiamondS",
	"EmptyDiamondM",
	"EmptyDiamondL",

	"EmptyDiamondSstart",
	"EmptyDiamondSend",
	"EmptyDiamondMstart",
	"EmptyDiamondMend",
	"EmptyDiamondLstart",
	"EmptyDiamondLend",

	"TriangleInS",
	"TriangleInM",
	"TriangleInL",

	"TriangleOutS",
	"TriangleOutM",
	"TriangleOutL",

	"EmptyTriangleInS",
	"EmptyTriangleInM",
	"EmptyTriangleInL",

	"EmptyTriangleOutS",
	"EmptyTriangleOutM",
	"EmptyTriangleOutL",

	"StopS",
	"StopM",
	"StopL",

	"SemiCircleIn",
	"SemiCircleOut",

	"CurveIn",
	"CurveOut",
	"CurvyCross",

	"Scissors",
	"Legs",
	"Torso",
	"Club",
	"RazorWire",

	"InfiniteLineStart",
	"InfiniteLineEnd",
}

StandardMarkerNames is an ordered list of marker names

View Source
var StandardMarkersMap = map[string]string{
	"-": "",
	"Arrow1Lstart": `<marker style="overflow:visible" id="Arrow1Lstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1Lstart">
      <path transform="scale(0.8) translate(12.5,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
    </marker>`,
	"Arrow1Lend": `<marker style="overflow:visible;" id="Arrow1Lend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1Lend">
      <path transform="scale(0.8) rotate(180) translate(12.5,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt;" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
    </marker>`,

	"Arrow1Mstart": `<marker style="overflow:visible" id="Arrow1Mstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1Mstart">
      <path transform="scale(0.4) translate(10,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
    </marker>`,
	"Arrow1Mend": `<marker style="overflow:visible;" id="Arrow1Mend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1Mend">
      <path transform="scale(0.4) rotate(180) translate(10,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt;" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
    </marker>`,

	"Arrow1Sstart": `<marker style="overflow:visible" id="Arrow1Sstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1Sstart">
      <path transform="scale(0.2) translate(6,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
    </marker>`,
	"Arrow1Send": `<marker style="overflow:visible;" id="Arrow1Send" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1Send">
      <path transform="scale(0.2) rotate(180) translate(6,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt;" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
    </marker>`,

	"Arrow2Lstart": `<marker style="overflow:visible" id="Arrow2Lstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow2Lstart">
      <path transform="scale(1.1) translate(1,0)" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round"/>
    </marker>`,
	"Arrow2Lend": `<marker style="overflow:visible;" id="Arrow2Lend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow2Lend">
      <path transform="scale(1.1) rotate(180) translate(1,0)" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round;"/>
    </marker>`,

	"Arrow2Mstart": `<marker style="overflow:visible" id="Arrow2Mstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow2Mstart">
      <path transform="scale(0.6) translate(0,0)" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round"/>
    </marker>`,
	"Arrow2Mend": `<marker style="overflow:visible;" id="Arrow2Mend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow2Mend">
      <path transform="scale(0.6) rotate(180) translate(0,0)" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round;"/>
    </marker>`,

	"Arrow2Sstart": `<marker style="overflow:visible" id="Arrow2Sstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow2Sstart">
      <path transform="scale(0.3) translate(-2.3,0)" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round"/>
    </marker>`,
	"Arrow2Send": `<marker style="overflow:visible;" id="Arrow2Send" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow2Send">
      <path transform="scale(0.3) rotate(180) translate(-2.3,0)" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round;"/>
    </marker>`,

	"Tail": `<marker style="overflow:visible" id="Tail" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Tail">
      <g transform="scale(-1.2)">
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round" d="M -3.8048674,-3.9585227 L 0.54352094,0"/>
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round" d="M -1.2866832,-3.9585227 L 3.0617053,0"/>
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round" d="M 1.3053582,-3.9585227 L 5.6537466,0"/>
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round" d="M -3.8048674,4.1775838 L 0.54352094,0.21974226"/>
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round" d="M -1.2866832,4.1775838 L 3.0617053,0.21974226"/>
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round" d="M 1.3053582,4.1775838 L 5.6537466,0.21974226"/>
      </g>
    </marker>`,

	"DistanceStart": `<marker inkscape:stockid="DistanceStart" orient="auto" refY="0.0" refX="0.0" id="DistanceStart" style="overflow:visible">
      <g id="g2300">
        <path id="path2306" d="M 0,0 L 2,0" style="fill:none;stroke:context-fill;stroke-width:1.15;stroke-linecap:square"/>
        <path id="path2302" d="M 0,0 L 13,4 L 9,0 13,-4 L 0,0 z " style="fill:context-stroke;fill-rule:evenodd;stroke:none"/>
        <path id="path2304" d="M 0,-4 L 0,40" style="fill:none;stroke:context-stroke;stroke-width:1;stroke-linecap:square"/>
      </g>
    </marker>`,
	"DistanceEnd": `<marker inkscape:stockid="DistanceEnd" orient="auto" refY="0.0" refX="0.0" id="DistanceEnd" style="overflow:visible">
      <g id="g2301">
        <path id="path2316" d="M 0,0 L -2,0" style="fill:none;stroke:context-fill;stroke-width:1.15;stroke-linecap:square"/>
        <path id="path2312" d="M 0,0 L -13,4 L -9,0 -13,-4 L 0,0 z " style="fill:context-stroke;fill-rule:evenodd;stroke:none"/>
        <path id="path2314" d="M 0,-4 L 0,40" style="fill:none;stroke:context-stroke;stroke-width:1;stroke-linecap:square"/>
      </g>
    </marker>`,

	"DotL": `<marker style="overflow:visible" id="DotL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DotL">
      <path transform="scale(0.8) translate(7.4, 1)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "/>
    </marker>`,
	"DotM": `<marker style="overflow:visible" id="DotM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DotM">
      <path transform="scale(0.4) translate(7.4, 1)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "/>
    </marker>`,
	"DotS": `<marker style="overflow:visible" id="DotS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DotS">
      <path transform="scale(0.2) translate(7.4, 1)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "/>
    </marker>`,

	"SquareL": `<marker style="overflow:visible" id="SquareL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="SquareL">
      <path transform="scale(0.8)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -5.0,-5.0 L -5.0,5.0 L 5.0,5.0 L 5.0,-5.0 L -5.0,-5.0 z "/>
    </marker>`,
	"SquareM": `<marker style="overflow:visible" id="SquareM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="SquareM">
      <path transform="scale(0.4)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -5.0,-5.0 L -5.0,5.0 L 5.0,5.0 L 5.0,-5.0 L -5.0,-5.0 z "/>
    </marker>`,
	"SquareS": `<marker style="overflow:visible" id="SquareS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="SquareS">
      <path transform="scale(0.2)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -5.0,-5.0 L -5.0,5.0 L 5.0,5.0 L 5.0,-5.0 L -5.0,-5.0 z "/>
    </marker>`,

	"DiamondL": `<marker style="overflow:visible" id="DiamondL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondL">       
      <path transform="scale(0.8)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"DiamondM": `<marker style="overflow:visible" id="DiamondM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondM">
      <path transform="scale(0.4)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"DiamondS": `<marker style="overflow:visible" id="DiamondS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondS">
      <path transform="scale(0.2)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,

	"DiamondLstart": `<marker style="overflow:visible" id="DiamondLstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondLstart">       
      <path transform="scale(0.8) translate(7,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"DiamondMstart": `<marker style="overflow:visible" id="DiamondMstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondMstart">
      <path transform="scale(0.4) translate(6.5,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"DiamondSstart": `<marker style="overflow:visible" id="DiamondSstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondSstart">
      <path transform="scale(0.2) translate(6,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,

	"DiamondLend": `<marker style="overflow:visible" id="DiamondLend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondLend">       
      <path transform="scale(0.8) translate(-7,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"DiamondMend": `<marker style="overflow:visible" id="DiamondMend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondMend">
      <path transform="scale(0.4) translate(-6.5,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"DiamondSend": `<marker style="overflow:visible" id="DiamondSend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="DiamondSend">
      <path transform="scale(0.2) translate(-6,0)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,

	"EmptyDiamondL": `<marker style="overflow:visible" id="EmptyDiamondL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondL">       
      <path transform="scale(0.8)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"EmptyDiamondM": `<marker style="overflow:visible" id="EmptyDiamondM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondM">
      <path transform="scale(0.4)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"EmptyDiamondS": `<marker style="overflow:visible" id="EmptyDiamondS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondS">
      <path transform="scale(0.2)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,

	"EmptyDiamondLstart": `<marker style="overflow:visible" id="EmptyDiamondLstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondLstart">       
      <path transform="scale(0.8) translate(7,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"EmptyDiamondMstart": `<marker style="overflow:visible" id="EmptyDiamondMstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondMstart">
      <path transform="scale(0.4) translate(6.5,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"EmptyDiamondSstart": `<marker style="overflow:visible" id="EmptyDiamondSstart" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondSstart">
      <path transform="scale(0.2) translate(6,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"EmptyDiamondLend": `<marker style="overflow:visible" id="EmptyDiamondLend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondLend">       
      <path transform="scale(0.8) translate(-7,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"EmptyDiamondMend": `<marker style="overflow:visible" id="EmptyDiamondMend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondMend">
      <path transform="scale(0.4) translate(-6.5,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,
	"EmptyDiamondSend": `<marker style="overflow:visible" id="EmptyDiamondSend" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyDiamondSend">
      <path transform="scale(0.2) translate(-6,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "/>
    </marker>`,

	"TriangleInL": `<marker style="overflow:visible" id="TriangleInL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="TriangleInL">
      <path transform="scale(-0.8)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"TriangleInM": `<marker style="overflow:visible" id="TriangleInM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="TriangleInM">
      <path transform="scale(-0.4)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"TriangleInS": `<marker style="overflow:visible" id="TriangleInS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="TriangleInS">
      <path transform="scale(-0.2)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"TriangleOutL": `<marker style="overflow:visible" id="TriangleOutL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="TriangleOutL">
      <path transform="scale(0.8)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"TriangleOutM": `<marker style="overflow:visible" id="TriangleOutM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="TriangleOutM">
      <path transform="scale(0.4)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"TriangleOutS": `<marker style="overflow:visible" id="TriangleOutS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="TriangleOutS">
      <path transform="scale(0.2)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,

	"EmptyTriangleInL": `<marker style="overflow:visible" id="EmptyTriangleInL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyTriangleInL">
      <path transform="scale(-0.8) translate(-6,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"EmptyTriangleInM": `<marker style="overflow:visible" id="EmptyTriangleInM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyTriangleInM">
      <path transform="scale(-0.4) translate(-4.5,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"EmptyTriangleInS": `<marker style="overflow:visible" id="EmptyTriangleInS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyTriangleInS">
      <path transform="scale(-0.2) translate(-3.0,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"EmptyTriangleOutL": `<marker style="overflow:visible" id="EmptyTriangleOutL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyTriangleOutL">
      <path transform="scale(0.8) translate(-6,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"EmptyTriangleOutM": `<marker style="overflow:visible" id="EmptyTriangleOutM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyTriangleOutM">
      <path transform="scale(0.4) translate(-4.5,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,
	"EmptyTriangleOutS": `<marker style="overflow:visible" id="EmptyTriangleOutS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="EmptyTriangleOutS">
      <path transform="scale(0.2) translate(-3.0,0)" style="fill-rule:evenodd;fill:context-fill;stroke:context-stroke;stroke-width:1.0pt" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "/>
    </marker>`,

	"StopL": `<marker style="overflow:visible" id="StopL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="StopL">
      <path transform="scale(0.8)" style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0pt" d="M 0.0,5.65 L 0.0,-5.65"/>
    </marker>`,
	"StopM": `<marker style="overflow:visible" id="StopM" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="StopM">
      <path transform="scale(0.4)" style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0pt" d="M 0.0,5.65 L 0.0,-5.65"/>
    </marker>`,
	"StopS": `<marker style="overflow:visible" id="StopS" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="StopS">
      <path transform="scale(0.2)" style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0pt" d="M 0.0,5.65 L 0.0,-5.65"/>
    </marker>`,

	"SemiCircleIn": `<marker style="overflow:visible" id="SemiCircleIn" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="SemiCircleIn">
      <path transform="scale(0.6)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -0.37450702,-0.045692580 C -0.37450702,2.7143074 1.8654930,4.9543074 4.6254930,4.9543074 L 4.6254930,-5.0456926 C 1.8654930,-5.0456926 -0.37450702,-2.8056926 -0.37450702,-0.045692580 z "/>
    </marker>`,
	"SemiCircleOut": `<marker style="overflow:visible" id="SemiCircleOut" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="SemiCircleOut">
      <path transform="scale(0.6) translate(7.125493,0.763446)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt" d="M -2.5,-0.80913858 C -2.5,1.9508614 -4.7400000,4.1908614 -7.5,4.1908614 L -7.5,-5.8091386 C -4.7400000,-5.8091386 -2.5,-3.5691386 -2.5,-0.80913858 z "/>
    </marker>`,

	"CurveIn": `<marker style="overflow:visible" id="CurveIn" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="CurveIn">
      <path transform="scale(0.6)" style="fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0pt;fill:none" d="M 4.6254930,-5.0456926 C 1.8654930,-5.0456926 -0.37450702,-2.8056926 -0.37450702,-0.045692580 C -0.37450702,2.7143074 1.8654930,4.9543074 4.6254930,4.9543074"/>
    </marker>`,
	"CurveOut": `<marker style="overflow:visible" id="CurveOut" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="CurveOut">
      <path transform="scale(0.6)" style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0pt" d="M -5.4129913,-5.0456926 C -2.6529913,-5.0456926 -0.41299131,-2.8056926 -0.41299131,-0.045692580 C -0.41299131,2.7143074 -2.6529913,4.9543074 -5.4129913,4.9543074"/>
    </marker>`,
	"CurvyCross": `<marker style="overflow:visible" id="CurvyCross" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="CurvyCross">
      <g transform="scale(0.6)">
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0pt" d="M 4.6254930,-5.0456926 C 1.8654930,-5.0456926 -0.37450702,-2.8056926 -0.37450702,-0.045692580 C -0.37450702,2.7143074 1.8654930,4.9543074 4.6254930,4.9543074"/>
        <path style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0pt" d="M -5.4129913,-5.0456926 C -2.6529913,-5.0456926 -0.41299131,-2.8056926 -0.41299131,-0.045692580 C -0.41299131,2.7143074 -2.6529913,4.9543074 -5.4129913,4.9543074"/>
      </g>
    </marker>`,

	"Scissors": `<marker style="overflow:visible" id="Scissors" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Scissors">
      <path style="fill:context-stroke;" d="M 9.0898857,-3.6061018 C 8.1198849,-4.7769976 6.3697607,-4.7358294 5.0623558,-4.2327734 L -3.1500488,-1.1548705 C -5.5383421,-2.4615840 -7.8983361,-2.0874077 -7.8983361,-2.7236578 C -7.8983361,-3.2209742 -7.4416699,-3.1119800 -7.5100293,-4.4068519 C -7.5756648,-5.6501286 -8.8736064,-6.5699315 -10.100428,-6.4884954 C -11.327699,-6.4958500 -12.599867,-5.5553341 -12.610769,-4.2584343 C -12.702194,-2.9520479 -11.603560,-1.7387447 -10.304005,-1.6532027 C -8.7816644,-1.4265411 -6.0857470,-2.3487593 -4.8210600,-0.082342643 C -5.7633447,1.6559151 -7.4350844,1.6607341 -8.9465707,1.5737277 C -10.201445,1.5014928 -11.708664,1.8611256 -12.307219,3.0945882 C -12.885586,4.2766744 -12.318421,5.9591904 -10.990470,6.3210002 C -9.6502788,6.8128279 -7.8098011,6.1912892 -7.4910978,4.6502760 C -7.2454393,3.4624530 -8.0864637,2.9043186 -7.7636052,2.4731223 C -7.5199917,2.1477623 -5.9728246,2.3362771 -3.2164999,1.0982979 L 5.6763468,4.2330688 C 6.8000164,4.5467672 8.1730685,4.5362646 9.1684433,3.4313614 L -0.051640930,-0.053722219 L 9.0898857,-3.6061018 z M -9.2179159,-5.5066058 C -7.9233569,-4.7838060 -8.0290767,-2.8230356 -9.3743431,-2.4433169 C -10.590861,-2.0196559 -12.145370,-3.2022863 -11.757521,-4.5207817 C -11.530373,-5.6026336 -10.104134,-6.0014137 -9.2179159,-5.5066058 z M -9.1616516,2.5107591 C -7.8108215,3.0096239 -8.0402087,5.2951947 -9.4138723,5.6023681 C -10.324932,5.9187072 -11.627422,5.4635705 -11.719569,4.3902287 C -11.897178,3.0851737 -10.363484,1.9060805 -9.1616516,2.5107591 z " id="schere"/>
    </marker>`,

	"Legs": `<marker style="overflow:visible" id="Legs" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Legs">
      <g transform="scale(-0.7)">
        <g transform="matrix(0,-1.000000,-1.000000,0,20.70862,21.31391)">
          <path style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0000000pt" d="M 21.221250,20.675360 C 14.311099,25.396517 18.766725,27.282204 15.380179,34.118595"/>
          <path style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0000000pt" d="M 21.398110,20.548120 C 20.037601,28.895644 24.934182,29.318060 25.903151,34.373078"/>
        </g>
        <path style="fill:context-stroke;fill-rule:evenodd;stroke-width:1.0000000pt" d="M -14.090070,-6.7318716 L -15.012238,-2.6884886 L -11.049487,-3.9115586 L -14.090070,-6.7318716 z "/>
        <path style="fill:context-stroke;fill-rule:evenodd;stroke-width:1.0000000pt" d="M -15.215679,4.5567534 L -13.341552,8.2563664 L -11.074678,4.7835114 L -15.215679,4.5567534 z "/>
      </g>
    </marker>`,

	"Torso": `<marker style="overflow:visible" id="Torso" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Torso">
      <g transform="scale(0.7)">
        <path style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.2500000" d="M -4.7792281,-3.2395420 C -2.4288541,-2.8736027 0.52103922,-1.3019943 0.25792722,0.38794346 C -0.0051877922,2.0778819 -2.2126741,2.6176539 -4.5630471,2.2517169 C -6.9134221,1.8857769 -8.5210350,0.75201414 -8.2579220,-0.93792336 C -7.9948090,-2.6278615 -7.1296041,-3.6054813 -4.7792281,-3.2395420 z "/>
        <path style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0000000pt" d="M 4.4598789,0.088665736 C -2.5564571,-4.3783320 5.2248769,-3.9061806 -0.84829578,-8.7197331"/>
        <path style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0000000pt" d="M 4.9298719,0.057520736 C -1.3872731,1.7494689 1.8027579,5.4782079 -4.9448731,7.5462725"/>
        <rect style="fill-rule:evenodd;fill:context-stroke;stroke-width:1.0000000pt" width="2.6366582" height="2.7608147" x="-10.391706" y="-1.7408575" transform="matrix(0.527536,-0.849533,0.887668,0.460484,0,0)"/>
        <rect style="fill-rule:evenodd;fill:context-stroke;stroke-width:1.0000000pt" width="2.7327356" height="2.8614161" x="4.9587269" y="-7.9629307" transform="matrix(0.671205,-0.741272,0.790802,0.612072,0,0)"/>
        <path style="fill:#ff0000;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0000000pt" d="M 16.779951 -28.685045 A 0.60731727 0.60731727 0 1 0 15.565317,-28.685045 A 0.60731727 0.60731727 0 1 0 16.779951 -28.685045 z" transform="matrix(0,-1.109517,1.109517,0,25.96648,19.71619)"/>
        <path style="fill:#ff0000;fill-opacity:0.75000000;fill-rule:evenodd;stroke:context-stroke;stroke-width:1.0000000pt" d="M 16.779951 -28.685045 A 0.60731727 0.60731727 0 1 0 15.565317,-28.685045 A 0.60731727 0.60731727 0 1 0 16.779951 -28.685045 z" transform="matrix(0,-1.109517,1.109517,0,26.82450,16.99126)"/>
      </g>
    </marker>`,

	"Club": `<marker style="overflow:visible" id="Club" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Club">
      <path transform="scale(0.6)" style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:0.74587913pt" d="M -1.5971367,-7.0977635 C -3.4863874,-7.0977635 -5.0235187,-5.5606321 -5.0235187,-3.6713813 C -5.0235187,-3.0147015 -4.7851656,-2.4444556 -4.4641095,-1.9232271 C -4.5028609,-1.8911157 -4.5437814,-1.8647646 -4.5806531,-1.8299921 C -5.2030765,-2.6849849 -6.1700514,-3.2751330 -7.3077730,-3.2751330 C -9.1970245,-3.2751331 -10.734155,-1.7380016 -10.734155,0.15124914 C -10.734155,2.0404999 -9.1970245,3.5776313 -7.3077730,3.5776313 C -6.3143268,3.5776313 -5.4391540,3.1355702 -4.8137404,2.4588126 C -4.9384274,2.8137041 -5.0235187,3.1803000 -5.0235187,3.5776313 C -5.0235187,5.4668819 -3.4863874,7.0040135 -1.5971367,7.0040135 C 0.29211394,7.0040135 1.8292454,5.4668819 1.8292454,3.5776313 C 1.8292454,2.7842354 1.5136868,2.0838028 1.0600576,1.5031550 C 2.4152718,1.7663868 3.7718375,2.2973711 4.7661444,3.8340272 C 4.0279463,3.0958289 3.5540908,1.7534117 3.5540908,-0.058529361 L 2.9247554,-0.10514681 L 3.5074733,-0.12845553 C 3.5074733,-1.9403966 3.9580199,-3.2828138 4.6962183,-4.0210121 C 3.7371277,-2.5387813 2.4390549,-1.9946496 1.1299838,-1.7134486 C 1.5341802,-2.2753578 1.8292454,-2.9268556 1.8292454,-3.6713813 C 1.8292454,-5.5606319 0.29211394,-7.0977635 -1.5971367,-7.0977635 z "/>
    </marker>`,

	"RazorWire": `<marker style="overflow:visible" orient="auto" refY="0" refX="0" id="RazorWire" inkscape:stockid="RazorWire">
      <path d="M 0.022727273,-0.74009011 L 0.022727273,0.69740989 L -7.7585227,3.0099099 L 10.678977,3.0099099 L 3.4914773,0.69740989 L 3.4914773,-0.74009011 L 10.741477,-2.8963401 L -7.7272727,-2.8963401 L 0.022727273,-0.74009011 z " style="fill:#808080;fill-opacity:1;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.1pt" transform="scale(0.8,0.8)"/>
    </marker>`,

	"InfiniteLineEnd": `<marker orient="auto" refY="0" refX="0" id="InfiniteLineEnd" inkscape:stockid="InfiniteLineEnd" style="overflow:visible">
      <g style="fill:context-stroke">
        <circle cx="3" cy="0" r="0.8"/>
        <circle cx="6.5" cy="0" r="0.8"/>
        <circle cx="10" cy="0" r="0.8"/>
      </g>
    </marker>`,
	"InfiniteLineStart": `<marker orient="auto" refY="0" refX="0" id="InfiniteLineStart" inkscape:stockid="InfiniteLineStart" style="overflow:visible">
      <g transform="translate(-13,0)" style="fill:context-stroke">
        <circle cx="3" cy="0" r="0.8"/>
        <circle cx="6.5" cy="0" r="0.8"/>
        <circle cx="10" cy="0" r="0.8"/>
      </g>
    </marker>`,
}

StandardMarkersMap is a map of the standard markers

View Source
var StandardSizesMap = map[StandardSizes]*StandardSizeValues{
	Img1280x720:  {units.UnitPx, 1280, 720},
	Img1920x1080: {units.UnitPx, 1920, 1080},
	Img3840x2160: {units.UnitPx, 3840, 2160},
	Img7680x4320: {units.UnitPx, 7680, 4320},
	Img1024x768:  {units.UnitPx, 1024, 768},
	Img720x480:   {units.UnitPx, 720, 480},
	Img640x480:   {units.UnitPx, 640, 480},
	Img320x240:   {units.UnitPx, 320, 240},
	A4:           {units.UnitMm, 210, 297},
	USLetter:     {units.UnitPt, 612, 792},
	USLegal:      {units.UnitPt, 612, 1008},
	A0:           {units.UnitMm, 841, 1189},
	A1:           {units.UnitMm, 594, 841},
	A2:           {units.UnitMm, 420, 594},
	A3:           {units.UnitMm, 297, 420},
	A5:           {units.UnitMm, 148, 210},
	A6:           {units.UnitMm, 105, 148},
	A7:           {units.UnitMm, 74, 105},
	A8:           {units.UnitMm, 52, 74},
	A9:           {units.UnitMm, 37, 52},
	A10:          {units.UnitMm, 26, 37},
}

StandardSizesMap is the map of size values for each standard size

View Source
var StandardSplits = Splits{
	{"Code", "2 text views, tabs", []float32{.1, .325, .325, .25}},
	{"Small", "1 text view, tabs", []float32{.1, .5, 0, .4}},
	{"BigTabs", "1 text view, big tabs", []float32{.1, .3, 0, .6}},
	{"Debug", "big command panel for debugging", []float32{0.1, 0.29539588, 0.2949658, 0.30963832}},
}

StandardSplits is the original compiled-in set of standard named splits.

View Source
var TreeViewType = types.AddType(&types.Type{Name: "cogentcore.org/cogent/vector.TreeView", IDName: "tree-view", Doc: "TreeView is a TreeView that knows how to operate on FileNode nodes", Embeds: []types.Field{{Name: "TreeView"}}, Fields: []types.Field{{Name: "VectorView", Doc: "the parent vectorview"}}, Instance: &TreeView{}})

TreeViewType is the types.Type for TreeView

View Source
var VectorViewType = types.AddType(&types.Type{Name: "cogentcore.org/cogent/vector.VectorView", IDName: "vector-view", Doc: "VectorView is the Vector SVG vector drawing program", Methods: []types.Method{{Name: "AddLayer", Doc: "AddLayer adds a new layer", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectGroup", Doc: "SelectGroup groups items together", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectUnGroup", Doc: "SelectUnGroup ungroups items from each other", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectRotateLeft", Doc: "SelectRotateLeft rotates the selection 90 degrees counter-clockwise", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectRotateRight", Doc: "SelectRotateRight rotates the selection 90 degrees clockwise", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectFlipHorizontal", Doc: "SelectFlipHorizontal flips the selection horizontally", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectFlipVertical", Doc: "SelectFlipVertical flips the selection vertically", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectRaiseTop", Doc: "SelectRaiseTop raises the selection to the top of the layer", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectRaise", Doc: "SelectRaise raises the selection by one level in the layer", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectLowerBottom", Doc: "SelectLowerBottom lowers the selection to the bottom of the layer", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SelectLower", Doc: "SelectLower lowers the selection by one level in the layer", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "DuplicateSelected", Doc: "DuplicateSelected duplicates selected items in SVG view, using TreeView methods", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "CopySelected", Doc: "CopySelected copies selected items in SVG view, using TreeView methods", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "CutSelected", Doc: "CutSelected cuts selected items in SVG view, using TreeView methods", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "PasteClip", Doc: "PasteClip pastes clipboard, using cur layer etc", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "OpenDrawing", Doc: "OpenDrawing opens a new .svg drawing", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"fnm"}, Returns: []string{"error"}}, {Name: "PromptPhysSize", Doc: "PromptPhysSize prompts for the physical size of the drawing and sets it", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "SaveDrawing", Doc: "SaveDrawing saves .svg drawing to current filename", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Returns: []string{"error"}}, {Name: "SaveDrawingAs", Doc: "SaveDrawingAs saves .svg drawing to given filename", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"fname"}, Returns: []string{"error"}}, {Name: "ExportPNG", Doc: "ExportPNG exports drawing to a PNG image (auto-names to same name\nwith .png suffix).  Calls inkscape -- needs to be on the PATH.\nspecify either width or height of resulting image, or nothing for\nphysical size as set.  Renders full current page -- do ResizeToContents\nto render just current contents.", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"width", "height"}, Returns: []string{"error"}}, {Name: "ExportPDF", Doc: "ExportPDF exports drawing to a PDF file (auto-names to same name\nwith .pdf suffix).  Calls inkscape -- needs to be on the PATH.\nspecify DPI of resulting image for effects rendering.\nRenders full current page -- do ResizeToContents\nto render just current contents.", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"dpi"}, Returns: []string{"error"}}, {Name: "ResizeToContents", Doc: "ResizeToContents resizes the drawing to just fit the current contents,\nincluding moving everything to start at upper-left corner,\npreserving the current grid offset, so grid snapping\nis preserved.", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "AddImage", Doc: "AddImage adds a new image node set to the given image", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"fname", "width", "height"}, Returns: []string{"error"}}, {Name: "UpdateAll", Doc: "UpdateAll updates the display", Directives: []types.Directive{{Tool: "types", Directive: "add"}}}, {Name: "Undo", Doc: "Undo undoes the last action", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Returns: []string{"string"}}, {Name: "Redo", Doc: "Redo redoes the previously undone action", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Returns: []string{"string"}}}, Embeds: []types.Field{{Name: "Frame"}}, Fields: []types.Field{{Name: "Filename", Doc: "full path to current drawing filename"}, {Name: "EditState", Doc: "current edit state"}}, Instance: &VectorView{}})

VectorViewType is the types.Type for VectorView

Functions

func AddNewDash

func AddNewDash(dary []float64) string

AddNewDash adds new dash pattern to available list, creating name based on pattern, which is returned. the given array is copied before storing, just in case.

func BBoxReshapeDelta

func BBoxReshapeDelta(bb *math32.Box2, delta float32, bbX, bbY BBoxPoints)

BBoxReshapeDelta moves given target dimensions by delta amounts

func DashIconsInit

func DashIconsInit()

DashIconsInit ensures that the dashes have been turned into icons for selectors, with same name (dash- prefix). Call this after startup, when configuring a gui element that needs it.

func DashMatchArray

func DashMatchArray(lwidth float64, dary []float64) (bool, string)

DashMatchArray returns the matching dash pattern for given array and line width. divides array and matches with wide tolerance. returns true if no match and thus new dash pattern was added, else false.

func DashMulWidth

func DashMulWidth(lwidth float64, dary []float64) []float64

DashMulWidth returns the dash array multiplied by the line width -- what is actually set

func DashString

func DashString(dary []float64) string

DashString returns string of dash array values

func DefaultColorSchemes

func DefaultColorSchemes() map[string]*ColorSettings

func DrawAlignMatchHoriz

func DrawAlignMatchHoriz(sp *core.Sprite, trgsz image.Point)

DrawAlignMatchHoriz renders a horizontal alignment line

func DrawAlignMatchVert

func DrawAlignMatchVert(sp *core.Sprite, trgsz image.Point)

DrawAlignMatchVert renders a vertical alignment line

func DrawRubberBandHoriz

func DrawRubberBandHoriz(sp *core.Sprite, trgsz image.Point)

DrawRubberBandHoriz renders a horizontal rubber band line

func DrawRubberBandVert

func DrawRubberBandVert(sp *core.Sprite, trgsz image.Point)

DrawRubberBandVert renders a vertical rubber band line

func DrawSpriteNodeCtrl

func DrawSpriteNodeCtrl(sp *core.Sprite, subtyp Sprites)

DrawSpriteNodeCtrl renders a NodePoint sprite handle

func DrawSpriteNodePoint

func DrawSpriteNodePoint(sp *core.Sprite, bbtyp Sprites)

DrawSpriteNodePoint renders a NodePoint sprite handle

func DrawSpriteReshape

func DrawSpriteReshape(sp *core.Sprite, bbtyp Sprites)

DrawSpriteReshape renders a Reshape sprite handle

func DrawSpriteSelect added in v0.0.2

func DrawSpriteSelect(sp *core.Sprite, bbtyp Sprites)

DrawSpriteSelect renders a Select sprite handle -- smaller

func HandleSpriteSize

func HandleSpriteSize(scale float32) (int, image.Point)

HandleSpriteSize returns the border size and overall size of handle-type sprites, with given scaling factor

func IconToMarkerName

func IconToMarkerName(icnm any) string

IconToMarkerName converts a icons.Icon (as an interface{}) to a marker name suitable for use (removes marker- prefix)

func InactivateSprites

func InactivateSprites(ctx core.Widget, typ Sprites)

InactivateSprites inactivates sprites of given type

func InitSettings added in v0.0.2

func InitSettings()

InitSettings must be called at startup in mainrun()

func LayerIsLocked

func LayerIsLocked(kn tree.Node) bool

LayerIsLocked returns true if layer is locked (insensitive = true)

func LayerIsVisible

func LayerIsVisible(kn tree.Node) bool

LayerIsVisible returns true if layer is visible

func LineSpriteSize

func LineSpriteSize() (int, int)

LineSpriteSize returns the border size and overall size of line-type sprites

func MarkerDeleteCtxtColors

func MarkerDeleteCtxtColors(mk *svg.Marker)

MarkerDeleteCtxtColors deletes context-* color names from standard code

func MarkerIconsInit

func MarkerIconsInit()

MarkerIconsInit ensures that the markers have been turned into icons for selectors, with marker- preix. Call this after startup, when configuring a gui element that needs it. It also initializes the AllMarkersSVGMap.

func MarkerNameToIcon

func MarkerNameToIcon(nm string) icons.Icon

MarkerNameToIcon converts a marker name to a icons.Icon

func MarkerSetColors

func MarkerSetColors(mk *svg.Marker, fill, stroke string)

MarkerSetColors sets color properties in each element

func MarkerSetProp

func MarkerSetProp(sg *svg.SVG, sii svg.Node, prop, name string, mc MarkerColors)

MarkerSetProp sets marker property for given node to given marker name (canonical)

func MarkerUpdateColorProp

func MarkerUpdateColorProp(sg *svg.SVG, sii svg.Node, prop string)

MarkerUpdateColorProp updates marker color for given marker property

func NewMarker

func NewMarker(sg *svg.SVG, name string, id int) *svg.Marker

NewMarker makes a new marker of given name and id in given svg, copying from existing one in AllMarkersSVGMap.

func NewMarkerFromXML

func NewMarkerFromXML(name, xml string) *svg.Marker

NewMarkerFromXML makes a new marker from given XML source.

func NodeIsLayer

func NodeIsLayer(kn tree.Node) bool

NodeIsLayer returns true if given node is a layer

func NodeIsMetaData

func NodeIsMetaData(kn tree.Node) bool

NodeIsMetaData returns true if given node is a MetaData

func NodeParentLayer

func NodeParentLayer(kn tree.Node) tree.Node

NodeParentLayer returns the parent group that is a layer -- nil if none

func ProportionalBBox

func ProportionalBBox(bb, orig math32.Box2) math32.Box2

func RecycleMarker

func RecycleMarker(sg *svg.SVG, sii svg.Node, name string, id int, mc MarkerColors) *svg.Marker

RecycleMarker ensures that given marker name and id exists in SVG, making a new one, copying from standard markers if not. if mc is MarkerCopyColor then sets marker colors to node colors.

func SetSpritePos

func SetSpritePos(sp *core.Sprite, pos image.Point)

SetSpritePos sets sprite position, taking into account relative offsets

func SetSpriteProperties added in v0.0.2

func SetSpriteProperties(sp *core.Sprite, typ, subtyp Sprites, idx int)

SetSpriteProperties sets sprite properties

func SnapToIncr

func SnapToIncr(val, off, incr float32) (float32, bool)

SnapToIncr snaps value to given increment, first subtracting given offset. Tolerance is determined by preferences, which is in screen pixels. Returns true if snapped.

func SnapToPt

func SnapToPt(val, snap float32) (float32, bool)

SnapToPt snaps value to given potential snap point, in screen pixel units. Tolerance is determined by preferences. Returns true if snapped.

func SplitsView

func SplitsView(pt *Splits)

SplitsView opens a view of a splits table

func Sprite

func Sprite(ctx core.Widget, typ, subtyp Sprites, idx int, trgsz image.Point) *core.Sprite

Sprite returns the given sprite in the context of the given widget, making it if not yet made. trgsz is the target size (e.g., for rubber band boxes)

func SpriteName

func SpriteName(typ, subtyp Sprites, idx int) string

SpriteName returns the unique name of the sprite based on main type, subtype (e.g., bbox) if relevant, and index if relevant

func SquareBBox

func SquareBBox(bb math32.Box2) math32.Box2

func ToolDoesBasicSelect

func ToolDoesBasicSelect(tl Tools) bool

ToolDoesBasicSelect returns true if tool should do select for clicks

Types

type AlignAnchors

type AlignAnchors int32 //enums:enum

AlignAnchors are ways of anchoring alignment

const (
	AlignFirst AlignAnchors = iota
	AlignLast
	AlignDrawing
	AlignSelectBox
)
const AlignAnchorsN AlignAnchors = 4

AlignAnchorsN is the highest valid value for type AlignAnchors, plus one.

func AlignAnchorsValues

func AlignAnchorsValues() []AlignAnchors

AlignAnchorsValues returns all possible values for the type AlignAnchors.

func (AlignAnchors) Desc

func (i AlignAnchors) Desc() string

Desc returns the description of the AlignAnchors value.

func (AlignAnchors) Int64

func (i AlignAnchors) Int64() int64

Int64 returns the AlignAnchors value as an int64.

func (AlignAnchors) MarshalText

func (i AlignAnchors) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*AlignAnchors) SetInt64

func (i *AlignAnchors) SetInt64(in int64)

SetInt64 sets the AlignAnchors value from an int64.

func (*AlignAnchors) SetString

func (i *AlignAnchors) SetString(s string) error

SetString sets the AlignAnchors value from its string representation, and returns an error if the string is invalid.

func (AlignAnchors) String

func (i AlignAnchors) String() string

String returns the string representation of this AlignAnchors value.

func (*AlignAnchors) UnmarshalText

func (i *AlignAnchors) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (AlignAnchors) Values

func (i AlignAnchors) Values() []enums.Enum

Values returns all possible values for the type AlignAnchors.

type AlignView

type AlignView struct {
	core.Layout

	AlignAnchorView views.EnumValue

	// the parent vectorview
	VectorView *VectorView `copier:"-" json:"-" xml:"-" view:"-"`
}

AlignView provides a range of alignment actions on selected objects.

func NewAlignView

func NewAlignView(parent tree.Node, name ...string) *AlignView

NewAlignView adds a new AlignView with the given name to the given parent: AlignView provides a range of alignment actions on selected objects.

func (*AlignView) AlignAnchor

func (av *AlignView) AlignAnchor() AlignAnchors

AlignAnchor returns the align anchor currently selected

func (*AlignView) Config

func (av *AlignView) Config()

func (*AlignView) New

func (t *AlignView) New() tree.Node

New returns a new *AlignView value

func (*AlignView) NodeType added in v0.0.2

func (t *AlignView) NodeType() *types.Type

NodeType returns the *types.Type of AlignView

func (*AlignView) SetAlignAnchorView

func (t *AlignView) SetAlignAnchorView(v views.EnumValue) *AlignView

SetAlignAnchorView sets the [AlignView.AlignAnchorView]

func (*AlignView) SetTooltip

func (t *AlignView) SetTooltip(v string) *AlignView

SetTooltip sets the [AlignView.Tooltip]

func (*AlignView) SetVectorView

func (t *AlignView) SetVectorView(v *VectorView) *AlignView

SetVectorView sets the [AlignView.VectorView]: the parent vectorview

type Aligns

type Aligns int32 //enums:enum -transform kebab

Aligns are ways of aligning items

const (
	// align right edges to left edge of anchor item
	AlignRightAnchor Aligns = iota

	// align left edges
	AlignLeft

	// align horizontal centers
	AlignCenter

	// align right edges
	AlignRight

	// align left edges to right edge of anchor item
	AlignLeftAnchor

	// align left text baseline edges
	AlignBaselineHoriz

	// align bottom edges to top edge of anchor item
	AlignBottomAnchor

	// align top edges
	AlignTop

	// align middle vertical point
	AlignMiddle

	// align bottom edges
	AlignBottom

	// align top edges to bottom edge of anchor item
	AlignTopAnchor

	// align baseline points vertically
	AlignBaselineVert
)
const AlignsN Aligns = 12

AlignsN is the highest valid value for type Aligns, plus one.

func AlignsValues

func AlignsValues() []Aligns

AlignsValues returns all possible values for the type Aligns.

func (Aligns) Desc

func (i Aligns) Desc() string

Desc returns the description of the Aligns value.

func (Aligns) Int64

func (i Aligns) Int64() int64

Int64 returns the Aligns value as an int64.

func (Aligns) MarshalText

func (i Aligns) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Aligns) SetInt64

func (i *Aligns) SetInt64(in int64)

SetInt64 sets the Aligns value from an int64.

func (*Aligns) SetString

func (i *Aligns) SetString(s string) error

SetString sets the Aligns value from its string representation, and returns an error if the string is invalid.

func (Aligns) String

func (i Aligns) String() string

String returns the string representation of this Aligns value.

func (*Aligns) UnmarshalText

func (i *Aligns) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Aligns) Values

func (i Aligns) Values() []enums.Enum

Values returns all possible values for the type Aligns.

type BBoxPoints

type BBoxPoints int32 //enums:enum

BBoxPoints are the different control points within a bounding box

const (
	BBLeft BBoxPoints = iota
	BBCenter
	BBRight
	BBTop
	BBMiddle
	BBBottom
)
const BBoxPointsN BBoxPoints = 6

BBoxPointsN is the highest valid value for type BBoxPoints, plus one.

func BBoxPointsValues

func BBoxPointsValues() []BBoxPoints

BBoxPointsValues returns all possible values for the type BBoxPoints.

func ReshapeBBoxPoints

func ReshapeBBoxPoints(reshape Sprites) (bbX, bbY BBoxPoints)

ReshapeBBoxPoints returns the X and Y BBoxPoints for given sprite Reshape control point.

func (BBoxPoints) Desc

func (i BBoxPoints) Desc() string

Desc returns the description of the BBoxPoints value.

func (BBoxPoints) Dim

func (ev BBoxPoints) Dim() math32.Dims

Dim returns the relevant dimension for this point

func (BBoxPoints) Int64

func (i BBoxPoints) Int64() int64

Int64 returns the BBoxPoints value as an int64.

func (BBoxPoints) MarshalText

func (i BBoxPoints) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (BBoxPoints) MoveDelta

func (ev BBoxPoints) MoveDelta(bb *math32.Box2, delta float32)

MoveDelta moves overall bbox (Max and Min) by delta (X or Y depending on pt)

func (BBoxPoints) PointBox

func (ev BBoxPoints) PointBox(bb math32.Box2) math32.Vector2

PointBox returns the relevant point for a given bounding box, where relevant dimension is from ValRect and other is midpoint -- for drawing lines. BBox is an image.Rectangle

func (BBoxPoints) PointRect

func (ev BBoxPoints) PointRect(bb image.Rectangle) math32.Vector2

PointRect returns the relevant point for a given bounding box, where relevant dimension is from ValRect and other is midpoint -- for drawing lines. BBox is an image.Rectangle

func (*BBoxPoints) SetInt64

func (i *BBoxPoints) SetInt64(in int64)

SetInt64 sets the BBoxPoints value from an int64.

func (*BBoxPoints) SetString

func (i *BBoxPoints) SetString(s string) error

SetString sets the BBoxPoints value from its string representation, and returns an error if the string is invalid.

func (BBoxPoints) SetValueBox added in v0.0.2

func (ev BBoxPoints) SetValueBox(bb *math32.Box2, val float32)

SetValueBox sets the relevant value for a given bounding box as a math32.Box2

func (BBoxPoints) String

func (i BBoxPoints) String() string

String returns the string representation of this BBoxPoints value.

func (*BBoxPoints) UnmarshalText

func (i *BBoxPoints) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (BBoxPoints) ValueBox added in v0.0.2

func (ev BBoxPoints) ValueBox(bb math32.Box2) float32

ValueBox returns the relevant value for a given bounding box as a math32.Box2

func (BBoxPoints) ValueRect added in v0.0.2

func (ev BBoxPoints) ValueRect(bb image.Rectangle) float32

ValueRect returns the relevant value for a given bounding box as an image.Rectangle

func (BBoxPoints) Values

func (i BBoxPoints) Values() []enums.Enum

Values returns all possible values for the type BBoxPoints.

type ColorSettings added in v0.0.2

type ColorSettings struct {

	// drawing background color
	Background color.Color

	// border color of the drawing
	Border color.Color

	// grid line color
	Vector color.Color
}

ColorSettings for

func (*ColorSettings) DarkDefaults added in v0.0.2

func (pf *ColorSettings) DarkDefaults()

func (*ColorSettings) Defaults added in v0.0.2

func (pf *ColorSettings) Defaults()

func (*ColorSettings) OpenJSON added in v0.0.2

func (pf *ColorSettings) OpenJSON(filename core.Filename) error

OpenJSON opens colors from a JSON-formatted file.

func (*ColorSettings) SaveJSON added in v0.0.2

func (pf *ColorSettings) SaveJSON(filename core.Filename) error

SaveJSON saves colors to a JSON-formatted file.

func (*ColorSettings) SetToSettings added in v0.0.2

func (pf *ColorSettings) SetToSettings()

SetToSettings sets this color scheme as the current active setting in overall default prefs.

type EditState

type EditState struct {

	// current tool in use
	Tool Tools

	// current action being performed -- used for undo labeling
	Action string

	// action data set at start of action
	ActData string

	// list of layers
	Layers Layers

	// current layer -- where new objects are inserted
	CurLayer string

	// current shared gradients, referenced by obj-specific gradients
	Gradients []*Gradient

	// current text styling info
	Text TextStyle

	// undo manager
	UndoMgr undo.Mgr

	// contents have changed
	Changed bool `view:"inactive"`

	// action mutex, protecting start / end of actions
	ActMu sync.Mutex `copier:"-" json:"-" xml:"-" view:"-"`

	// selected item(s)
	Selected map[svg.Node]*SelectedState `copier:"-" json:"-" xml:"-" view:"-"`

	// selection just happened on press, and no drag happened in between
	SelectNoDrag bool

	// true if a new text item was made while dragging
	NewTextMade bool

	// point where dragging started, mouse coords
	DragStartPos image.Point

	// current dragging position, mouse coords
	DragCurPos image.Point

	// current selection bounding box
	SelectBBox math32.Box2

	// number of current selectbox sprites
	NSelectSprites int

	// last select action position -- continued clicks in same area lead to deeper selection
	LastSelectPos image.Point

	// recently selected item(s) -- within the same selection position
	RecentlySelected map[svg.Node]*SelectedState `copier:"-" json:"-" xml:"-" view:"-"`

	// bbox at start of dragging
	DragSelectStartBBox math32.Box2

	// current bbox during dragging -- non-snapped version
	DragSelectCurrentBBox math32.Box2

	// current effective bbox during dragging -- snapped version
	DragSelectEffectiveBBox math32.Box2

	// potential points of alignment for dragging
	AlignPts [BBoxPointsN][]math32.Vector2

	// number of current node sprites in use
	NNodeSprites int

	// currently manipulating path object
	ActivePath *svg.Path

	// current path node points
	PathNodes []*PathNode

	// selected path nodes
	PathSelect map[int]struct{}

	// current path command indexes within PathNodes -- where the commands start
	PathCommands []int

	// the parent vectorview
	VectorView *VectorView `copier:"-" json:"-" xml:"-" view:"-"`
}

EditState has all the current edit state information

func (*EditState) ActDone

func (es *EditState) ActDone()

ActDone finishes an action, resetting action to ""

func (*EditState) ActStart

func (es *EditState) ActStart(act, data string)

ActStart starts an action, locking the mutex so only one can start

func (*EditState) ActUnlock

func (es *EditState) ActUnlock()

ActUnlock unlocks the action mutex -- after done doing all action starting steps

func (*EditState) ConfigDefaultGradient

func (es *EditState) ConfigDefaultGradient()

ConfigDefaultGradient configures a new default gradient

func (*EditState) DragNodeStart

func (es *EditState) DragNodeStart(pos image.Point)

DragNodeStart captures the current state at start of node dragging. position is starting position.

func (*EditState) DragReset

func (es *EditState) DragReset()

DragReset resets drag state information

func (*EditState) DragSelStart

func (es *EditState) DragSelStart(pos image.Point)

DragSelStart captures the current state at start of dragging manipulation with selected items. position is starting position.

func (*EditState) FirstSelectedNode

func (es *EditState) FirstSelectedNode() svg.Node

FirstSelectedNode returns the first selected node, that is not a Group (recurses into groups)

func (*EditState) FirstSelectedPath

func (es *EditState) FirstSelectedPath() *svg.Path

FirstSelectedPath returns the first selected Path, that is not a Group (recurses into groups)

func (*EditState) HasSelected

func (es *EditState) HasSelected() bool

HasSelected returns true if there are selected items

func (*EditState) InAction

func (es *EditState) InAction() bool

InAction reports whether we currently doing an action

func (*EditState) Init

func (es *EditState) Init(vv *VectorView)

Init initializes the edit state -- e.g. after opening a new file

func (*EditState) IsSelected

func (es *EditState) IsSelected(itm svg.Node) bool

IsSelected returns the selected status of given slice index

func (*EditState) NewRecents

func (es *EditState) NewRecents()

func (*EditState) NewSelected

func (es *EditState) NewSelected()

NewSelected makes a new Selected list

func (*EditState) PosInLastSelect added in v0.0.2

func (es *EditState) PosInLastSelect(pos image.Point) bool

PosInLastSelect returns true if position is within tolerance of last selection point

func (*EditState) ResetSelected

func (es *EditState) ResetSelected()

ResetSelected resets the selection list, including recents

func (*EditState) SanitizeSelected

func (es *EditState) SanitizeSelected()

SanitizeSelected ensures that the current selected list makes sense. E.g., it prevents having a group and a child both in the selected list (removes the parent group).

func (*EditState) Select

func (es *EditState) Select(itm svg.Node)

Select selects given item (if not already selected) -- updates select status of index label

func (*EditState) SelectAction

func (es *EditState) SelectAction(n svg.Node, mode events.SelectModes, pos image.Point)

SelectAction is called when a select action has been received (e.g., a mouse click) -- translates into selection updates -- gets selection mode from mouse event (ExtendContinuous, ExtendOne)

func (*EditState) SelectedList

func (es *EditState) SelectedList(descendingSort bool) []svg.Node

SelectedList returns list of selected items, sorted either ascending or descending according to order of selection

func (*EditState) SelectedListDepth

func (es *EditState) SelectedListDepth(sv *SVGView, descendingSort bool) []svg.Node

SelectedListDepth returns list of selected items, sorted either ascending or descending according to depth: ascending = deepest first, descending = highest first

func (*EditState) SelectedNames

func (es *EditState) SelectedNames() []string

SelectedNames returns names of selected items, in order selected

func (*EditState) SelectedNamesString

func (es *EditState) SelectedNamesString() string

SelectedNamesString returns names of selected items as a space-separated single string. If over 256 chars long, then truncated.

func (*EditState) SelectedToRecents

func (es *EditState) SelectedToRecents()

func (*EditState) StartRecents

func (es *EditState) StartRecents(pos image.Point)

StartRecents starts a new list of recently-selected items

func (*EditState) Unselect

func (es *EditState) Unselect(itm svg.Node)

Unselect unselects given idx (if selected)

func (*EditState) UpdateSelectBBox added in v0.0.2

func (es *EditState) UpdateSelectBBox()

UpdateSelectBBox updates the current selection bbox surrounding all selected items

type GradStop

type GradStop struct {

	// color -- alpha is ignored -- set opacity separately
	Color color.Color

	// opacity determines how opaque color is - used instead of alpha in color
	Opacity float64

	// offset position along the gradient vector: 0 = start, 1 = nominal end
	Offset float64
}

GradStop represents a single gradient stop

type Gradient

type Gradient struct {

	// icon of gradient -- generated to display each gradient
	Ic core.SVG `edit:"-" tableview:"no-header" width:"5"`

	// name of gradient (id)
	Id string `edit:"-" width:"6"`

	// full name of gradient as SVG element
	Name string `view:"-"`

	// gradient stops
	Stops []*GradStop
}

Gradient represents a single gradient that defines stops (referenced in StopName of other gradients)

func (*Gradient) UpdateIcon

func (gr *Gradient) UpdateIcon()

UpdateIcon updates icon

type Layer

type Layer struct {
	Name string

	// visiblity toggle
	Vis bool

	// lock toggle
	Lck bool
}

Layer represents one layer group

func (*Layer) FromNode

func (l *Layer) FromNode(k tree.Node)

FromNode copies state / prop values from given node

func (*Layer) ToNode

func (l *Layer) ToNode(k tree.Node)

ToNode copies state / prop values to given node

type Layers

type Layers []*Layer

Layers is the list of all layers

func (*Layers) LayerIndexByName added in v0.0.2

func (ly *Layers) LayerIndexByName(nm string) int

func (*Layers) LayersUpdated

func (ly *Layers) LayersUpdated(sv *SVGView)

func (*Layers) SyncLayers

func (ly *Layers) SyncLayers(sv *SVGView)

type MarkerColors

type MarkerColors int32 //enums:enum -trim-prefix Marker

MarkerColors are the drawing tools

const (
	// use the default color of marker (typically black)
	MarkerDef MarkerColors = iota

	// copy color of object using marker (create separate marker object per element)
	MarkerCopy

	// marker has its own separate custom color
	MarkerCust
)
const MarkerColorsN MarkerColors = 3

MarkerColorsN is the highest valid value for type MarkerColors, plus one.

func MarkerColorsValues

func MarkerColorsValues() []MarkerColors

MarkerColorsValues returns all possible values for the type MarkerColors.

func MarkerFromNodeProp

func MarkerFromNodeProp(kn tree.Node, prop string) (string, int, MarkerColors)

MarkerFromNodeProp returns the marker name (canonicalized -- no id) and id and color type

func (MarkerColors) Desc

func (i MarkerColors) Desc() string

Desc returns the description of the MarkerColors value.

func (MarkerColors) Int64

func (i MarkerColors) Int64() int64

Int64 returns the MarkerColors value as an int64.

func (MarkerColors) MarshalText

func (i MarkerColors) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*MarkerColors) SetInt64

func (i *MarkerColors) SetInt64(in int64)

SetInt64 sets the MarkerColors value from an int64.

func (*MarkerColors) SetString

func (i *MarkerColors) SetString(s string) error

SetString sets the MarkerColors value from its string representation, and returns an error if the string is invalid.

func (MarkerColors) String

func (i MarkerColors) String() string

String returns the string representation of this MarkerColors value.

func (*MarkerColors) UnmarshalText

func (i *MarkerColors) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (MarkerColors) Values

func (i MarkerColors) Values() []enums.Enum

Values returns all possible values for the type MarkerColors.

type PaintTypes

type PaintTypes int32 //enums:enum -trim-prefix Paint
const (
	PaintOff PaintTypes = iota
	PaintSolid
	PaintLinear
	PaintRadial
	PaintInherit
)
const PaintTypesN PaintTypes = 5

PaintTypesN is the highest valid value for type PaintTypes, plus one.

func PaintTypesValues

func PaintTypesValues() []PaintTypes

PaintTypesValues returns all possible values for the type PaintTypes.

func (PaintTypes) Desc

func (i PaintTypes) Desc() string

Desc returns the description of the PaintTypes value.

func (PaintTypes) Int64

func (i PaintTypes) Int64() int64

Int64 returns the PaintTypes value as an int64.

func (PaintTypes) MarshalText

func (i PaintTypes) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*PaintTypes) SetInt64

func (i *PaintTypes) SetInt64(in int64)

SetInt64 sets the PaintTypes value from an int64.

func (*PaintTypes) SetString

func (i *PaintTypes) SetString(s string) error

SetString sets the PaintTypes value from its string representation, and returns an error if the string is invalid.

func (PaintTypes) String

func (i PaintTypes) String() string

String returns the string representation of this PaintTypes value.

func (*PaintTypes) UnmarshalText

func (i *PaintTypes) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (PaintTypes) Values

func (i PaintTypes) Values() []enums.Enum

Values returns all possible values for the type PaintTypes.

type PaintView

type PaintView struct {
	core.Layout

	// paint type for stroke
	StrokeType PaintTypes

	// name of gradient with stops
	StrokeStops string

	// paint type for fill
	FillType PaintTypes

	// name of gradient with stops
	FillStops string

	// the parent vectorview
	VectorView *VectorView `copier:"-" json:"-" xml:"-" view:"-"`
}

PaintView provides editing of basic Stroke and Fill painting parameters for selected items

func NewPaintView

func NewPaintView(parent tree.Node, name ...string) *PaintView

NewPaintView adds a new PaintView with the given name to the given parent: PaintView provides editing of basic Stroke and Fill painting parameters for selected items

func (*PaintView) Config

func (pv *PaintView) Config()

func (*PaintView) FillProp

func (pv *PaintView) FillProp() string

FillProp returns the fill property string according to current settings

func (*PaintView) FillStack

func (pv *PaintView) FillStack() *core.Frame

FillStack returns the fill stack frame

func (*PaintView) IsFillOn

func (pv *PaintView) IsFillOn() bool

IsFillOn returns true if Fill is active

func (*PaintView) IsStrokeOn

func (pv *PaintView) IsStrokeOn() bool

IsStrokeOn returns true if stroke is active

func (*PaintView) MarkerProperties added in v0.0.2

func (pv *PaintView) MarkerProperties() (start, mid, end string, sc, mc, ec MarkerColors)

MarkerProp returns the marker property string according to current settings along with color type to set.

func (*PaintView) New

func (t *PaintView) New() tree.Node

New returns a new *PaintView value

func (*PaintView) NodeType added in v0.0.2

func (t *PaintView) NodeType() *types.Type

NodeType returns the *types.Type of PaintView

func (*PaintView) SelectFillGrad

func (pv *PaintView) SelectFillGrad()

func (*PaintView) SelectStrokeGrad

func (pv *PaintView) SelectStrokeGrad()

func (*PaintView) SetFillStops

func (t *PaintView) SetFillStops(v string) *PaintView

SetFillStops sets the [PaintView.FillStops]: name of gradient with stops

func (*PaintView) SetFillType

func (t *PaintView) SetFillType(v PaintTypes) *PaintView

SetFillType sets the [PaintView.FillType]: paint type for fill

func (*PaintView) SetProperties added in v0.0.2

func (pv *PaintView) SetProperties(sii svg.Node)

SetProperties sets the properties for given node according to current settings

func (*PaintView) SetStrokeStops

func (t *PaintView) SetStrokeStops(v string) *PaintView

SetStrokeStops sets the [PaintView.StrokeStops]: name of gradient with stops

func (*PaintView) SetStrokeType

func (t *PaintView) SetStrokeType(v PaintTypes) *PaintView

SetStrokeType sets the [PaintView.StrokeType]: paint type for stroke

func (*PaintView) SetTooltip

func (t *PaintView) SetTooltip(v string) *PaintView

SetTooltip sets the [PaintView.Tooltip]

func (*PaintView) SetVectorView

func (t *PaintView) SetVectorView(v *VectorView) *PaintView

SetVectorView sets the [PaintView.VectorView]: the parent vectorview

func (*PaintView) StrokeDashProp

func (pv *PaintView) StrokeDashProp() []float64

StrokeDashProp returns stroke-dasharray property as an array (nil = none) these values need to be multiplied by line widths for each item.

func (*PaintView) StrokeProp

func (pv *PaintView) StrokeProp() string

StrokeProp returns the stroke property string according to current settings

func (*PaintView) StrokeStack

func (pv *PaintView) StrokeStack() *core.Frame

StrokeStack returns the stroke stack frame

func (*PaintView) StrokeWidthProp

func (pv *PaintView) StrokeWidthProp() string

StrokeWidthProp returns stroke-width property

type PathNode

type PathNode struct {

	// path command
	Cmd svg.PathCmds

	// previous path command
	PrevCmd svg.PathCmds

	// starting index of command
	CmdIndex int

	// index of points in data stream
	Index int

	// logical index of point within current command (0 = first point, etc)
	PtIndex int

	// local coords abs previous current point that is starting point for this command
	PCp math32.Vector2

	// local coords abs current point
	Cp math32.Vector2

	// main point coords in window (dot) coords
	WinPt math32.Vector2

	// control point coords in window (dot) coords (nil until manipulated)
	WinCtrls []math32.Vector2
}

PathNode is info about each node in a path that is being edited

type PhysSize

type PhysSize struct {

	// select a standard size -- this will set units and size
	StandardSize StandardSizes

	// for standard size, use first number as width, second as height
	Portrait bool

	// default units to use, e.g., in line widths etc
	Units units.Units

	// drawing size, in Units
	Size math32.Vector2

	// grid spacing, in units of ViewBox size
	Grid float32
}

PhysSize specifies the physical size of the drawing, when making a new one

func (*PhysSize) Defaults

func (ps *PhysSize) Defaults()

func (*PhysSize) SetFromSVG

func (ps *PhysSize) SetFromSVG(sv *SVGView)

SetFromSVG sets from svg

func (*PhysSize) SetStandardSize added in v0.0.2

func (ps *PhysSize) SetStandardSize(std StandardSizes) error

SetStandardSize sets drawing to a standard size

func (*PhysSize) SetToSVG

func (ps *PhysSize) SetToSVG(sv *SVGView)

SetToSVG sets svg from us

func (*PhysSize) SetToStandardSize added in v0.0.2

func (ps *PhysSize) SetToStandardSize() error

SetToStandardSize sets drawing to the current standard size value

func (*PhysSize) Update

func (ps *PhysSize) Update()

type Preferences

type Preferences struct {

	// default physical size, when app is started without opening a file
	Size PhysSize

	// active color preferences
	Colors ColorSettings

	// named color schemes -- has Light and Dark schemes by default
	ColorSchemes map[string]*ColorSettings

	// default shape styles
	ShapeStyle styles.Paint

	// default text styles
	TextStyle styles.Paint

	// default line styles
	PathStyle styles.Paint

	// default line styles
	LineStyle styles.Paint

	// turns on the grid display
	VectorDisp bool

	// snap positions and sizes to underlying grid
	SnapVector bool

	// snap positions and sizes to line up with other elements
	SnapGuide bool

	// snap node movements to align with guides
	SnapNodes bool

	// number of screen pixels around target point (in either direction) to snap
	SnapTol int `min:"1"`

	// named-split config in use for configuring the splitters
	SplitName SplitName

	// environment variables to set for this app -- if run from the command line, standard shell environment variables are inherited, but on some OS's (Mac), they are not set when run as a gui app
	EnvVars map[string]string

	// flag that is set by StructView by virtue of changeflag tag, whenever an edit is made.  Used to drive save menus etc.
	Changed bool `view:"-" changeflag:"+" json:"-" xml:"-"`
}

Preferences is the overall Vector preferences

func (*Preferences) ApplyEnvVars

func (pf *Preferences) ApplyEnvVars()

ApplyEnvVars applies environment variables set in EnvVars

func (*Preferences) DarkMode

func (pf *Preferences) DarkMode()

DarkMode sets colors to dark mode

func (*Preferences) Defaults

func (pf *Preferences) Defaults()

func (*Preferences) EditSplits

func (pf *Preferences) EditSplits()

EditSplits opens the SplitsView editor to customize saved splitter settings

func (*Preferences) LightMode

func (pf *Preferences) LightMode()

LightMode sets colors to light mode

func (*Preferences) Open

func (pf *Preferences) Open() error

Open preferences from app standard prefs directory, and applies them

func (*Preferences) Save

func (pf *Preferences) Save() error

Save Preferences to app standard prefs directory

func (*Preferences) Update

func (pf *Preferences) Update()

func (*Preferences) UpdateAll

func (pf *Preferences) UpdateAll()

UpdateAll updates all open windows with current preferences -- triggers rebuild of default styles.

type SVGView

type SVGView struct {
	core.SVG

	// the parent vectorview
	VectorView *VectorView `copier:"-" json:"-" xml:"-" view:"-" set:"-"`

	// view translation offset (from dragging)
	Trans math32.Vector2 `set:"-"`

	// view scaling (from zooming)
	Scale float32 `set:"-"`

	// grid spacing, in native ViewBox units
	Grid float32 ` set:"-"`

	// effective grid spacing given Scale level
	VectorEff float32 `edit:"-" set:"-"`

	// background pixels, includes page outline and grid
	BgPixels *image.RGBA `copier:"-" json:"-" xml:"-" view:"-" set:"-"`
	// contains filtered or unexported fields
}

SVGView is the element for viewing, interacting with the SVG

func NewSVGView

func NewSVGView(parent tree.Node, name ...string) *SVGView

NewSVGView adds a new SVGView with the given name to the given parent: SVGView is the element for viewing, interacting with the SVG

func (*SVGView) BgNeedsUpdate

func (sv *SVGView) BgNeedsUpdate() bool

func (*SVGView) ConstrainPoint

func (sv *SVGView) ConstrainPoint(st, rawpt math32.Vector2) (math32.Vector2, bool)

ConstrainPoint constrains movement of point relative to starting point to either X, Y or diagonal. returns constrained point, and whether the constraint is along the diagonal, which can then trigger reshaping the object to be along the diagonal as well. also adds constraint to AlignMatches.

func (*SVGView) ContentsBBox

func (sv *SVGView) ContentsBBox() math32.Box2

ContentsBBox returns the object-level box of the entire contents

func (*SVGView) DepthMap

func (sv *SVGView) DepthMap() map[tree.Node]int

DepthMap returns a map of all nodes and their associated depth count counting up from 0 as the deepest, first drawn node.

func (*SVGView) DragMove

func (sv *SVGView) DragMove(e events.Event)

DragMove is when dragging a selection for moving

func (*SVGView) EditNode

func (sv *SVGView) EditNode(kn tree.Node)

EditNode opens a structview editor on node

func (*SVGView) EditState

func (sv *SVGView) EditState() *EditState

EditState returns the EditState for this view

func (*SVGView) EnsureBgSize

func (sv *SVGView) EnsureBgSize() bool

EnsureBgSize ensures Bg is set to the right size -- returns true if resized

func (*SVGView) FillViewportWithBg

func (sv *SVGView) FillViewportWithBg()

func (*SVGView) GatherAlignPoints

func (sv *SVGView) GatherAlignPoints()

GatherAlignPoints gets all the potential points of alignment for objects not in selection group

func (*SVGView) Gradients

func (sv *SVGView) Gradients() []*Gradient

Gradients returns the currently-defined gradients with stops that are shared among obj-specific ones

func (*SVGView) HandleEvents

func (sv *SVGView) HandleEvents()

func (*SVGView) MakeNodeContextMenu

func (sv *SVGView) MakeNodeContextMenu(m *core.Scene, kn tree.Node)

MakeNodeContextMenu makes the menu of options for context right click

func (*SVGView) ManipDone

func (sv *SVGView) ManipDone()

ManipDone happens when a manipulation has finished: resets action, does render

func (*SVGView) ManipStart

func (sv *SVGView) ManipStart(act, data string)

ManipStart is called at the start of a manipulation, saving the state prior to the action

func (*SVGView) ManipUpdate

func (sv *SVGView) ManipUpdate()

ManipUpdate is called from goroutine: 'go sv.ManipUpdate()' to update the current display while manipulating. It checks if already rendering and if so, just returns immediately, so that updates are not stacked up and laggy.

func (*SVGView) MetaData

func (sv *SVGView) MetaData(mknew bool) (main, grid *svg.MetaData)

MetaData returns the overall metadata and grid if present. if mknew is true, it will create new ones if not found.

func (*SVGView) New

func (t *SVGView) New() tree.Node

New returns a new *SVGView value

func (*SVGView) NewEl

func (sv *SVGView) NewEl(typ *types.Type) svg.Node

NewEl makes a new SVG element, giving it a new unique name. Uses currently active layer if set.

func (*SVGView) NewElDrag

func (sv *SVGView) NewElDrag(typ *types.Type, start, end image.Point) svg.Node

NewElDrag makes a new SVG element during the drag operation

func (*SVGView) NewPath

func (sv *SVGView) NewPath(start, end image.Point) *svg.Path

NewPath makes a new SVG Path element during the drag operation

func (*SVGView) NewText

func (sv *SVGView) NewText(start, end image.Point) svg.Node

NewText makes a new Text element with embedded tspan

func (*SVGView) NodeContextMenuPos

func (sv *SVGView) NodeContextMenuPos(pos image.Point) image.Point

ContextMenuPos returns position to use for context menu, based on input position

func (*SVGView) NodeType added in v0.0.2

func (t *SVGView) NodeType() *types.Type

NodeType returns the *types.Type of SVGView

func (*SVGView) OnInit

func (sv *SVGView) OnInit()

func (*SVGView) PathNodeSetOnePoint

func (sv *SVGView) PathNodeSetOnePoint(path *svg.Path, pts []*PathNode, pidx int, dv math32.Vector2, svoff math32.Vector2)

PathNodeMoveOnePoint moves given node index by given delta in window coords and all following points up to cmd = z or m are moved in the opposite direction to compensate, so only the one point is moved in effect. svoff is the window starting vector coordinate for view.

func (*SVGView) PathNodeSetPoint

func (sv *SVGView) PathNodeSetPoint(path *svg.Path, pn *PathNode, npt math32.Vector2)

PathNodeSetPoint sets data point for path node to given new point value which is in *absolute* (but local) coordinates -- translates into relative coordinates as needed.

func (*SVGView) PathNodes

func (sv *SVGView) PathNodes(path *svg.Path) ([]*PathNode, []int)

PathNodes returns the PathNode data for given path data, and a list of indexes where commands start

func (*SVGView) ReadMetaData

func (sv *SVGView) ReadMetaData()

ReadMetaData reads meta data of drawing

func (*SVGView) Redo

func (sv *SVGView) Redo() string

Redo redoes one step, returning the action that was redone

func (*SVGView) RemoveNodeSprites

func (sv *SVGView) RemoveNodeSprites()

func (*SVGView) RemoveSelSprites

func (sv *SVGView) RemoveSelSprites()

func (*SVGView) RenderBg

func (sv *SVGView) RenderBg()

RenderBg renders our background image

func (*SVGView) ResizeToContents

func (sv *SVGView) ResizeToContents(grid_off bool)

ResizeToContents resizes the drawing to just fit the current contents, including moving everything to start at upper-left corner, optionally preserving the current grid offset, so grid snapping is preserved -- recommended.

func (*SVGView) Root

func (sv *SVGView) Root() *svg.SVGNode

Root returns the root svg.SVGNode.

func (*SVGView) SSVG

func (sv *SVGView) SSVG() *svg.SVG

SSVG returns the underlying svg.SVG.

func (*SVGView) SelectContainsPoint

func (sv *SVGView) SelectContainsPoint(pt image.Point, leavesOnly, excludeSel bool) svg.Node

SelectContainsPoint finds the first node whose BBox contains the given point in scene coordinates; nil if none. If leavesOnly is set then only nodes that have no nodes (leaves, terminal nodes) will be considered. if leavesOnly, only terminal leaves (no children) are included if excludeSel, any leaf nodes that are within the current edit selection are excluded,

func (*SVGView) SelectWithinBBox

func (sv *SVGView) SelectWithinBBox(bbox image.Rectangle, leavesOnly bool) []svg.Node

SelectWithinBBox returns a list of all nodes whose BBox is fully contained within the given BBox. SVG version excludes layer groups.

func (*SVGView) SetBBoxSpritePos

func (sv *SVGView) SetBBoxSpritePos(typ Sprites, idx int, bbox math32.Box2)

SetBBoxSpritePos sets positions of given type of sprites

func (*SVGView) SetMetaData

func (sv *SVGView) SetMetaData()

SetMetaData sets meta data of drawing

func (*SVGView) SetRubberBand

func (sv *SVGView) SetRubberBand(cur image.Point)

SetRubberBand updates the rubber band postion

func (*SVGView) SetSVGName

func (sv *SVGView) SetSVGName(el svg.Node)

SetSVGName sets the name of the element to standard type + id name

func (*SVGView) SetSelSpritePos

func (sv *SVGView) SetSelSpritePos()

func (*SVGView) SetTooltip

func (t *SVGView) SetTooltip(v string) *SVGView

SetTooltip sets the [SVGView.Tooltip]

func (*SVGView) SetTransform

func (sv *SVGView) SetTransform()

SetTransform sets the transform based on Trans and Scale values

func (*SVGView) ShowAlignMatches

func (sv *SVGView) ShowAlignMatches(pts []image.Rectangle, typs []BBoxPoints)

ShowAlignMatches draws the align matches as given between BBox Min - Max. typs are corresponding bounding box sources.

func (*SVGView) SnapBBox

func (sv *SVGView) SnapBBox(rawbb math32.Box2) math32.Box2

SnapBBox does snapping on given raw bbox according to preferences, aligning movement of bbox edges / centers relative to other bboxes.. returns snapped bbox.

func (*SVGView) SnapPoint

func (sv *SVGView) SnapPoint(rawpt math32.Vector2) math32.Vector2

SnapPoint does snapping on one raw point, given that point, in window coordinates. returns the snapped point.

func (*SVGView) SnapPointToVector

func (sv *SVGView) SnapPointToVector(rawpt math32.Vector2) math32.Vector2

func (*SVGView) SpriteRotateDrag

func (sv *SVGView) SpriteRotateDrag(sp Sprites, delta image.Point)

SpriteRotateDrag processes a mouse rotate drag event on a selection sprite

func (*SVGView) TransformAllLeaves

func (sv *SVGView) TransformAllLeaves(trans math32.Vector2, scale math32.Vector2, rot float32, pt math32.Vector2)

TransformAllLeaves transforms all the leaf items in the drawing (not groups) uses ApplyDeltaTransform manipulation.

func (*SVGView) Undo

func (sv *SVGView) Undo() string

Undo undoes one step, returning the action that was undone

func (*SVGView) UndoSave

func (sv *SVGView) UndoSave(action, data string)

UndoSave save current state for potential undo

func (*SVGView) UndoSaveReplace

func (sv *SVGView) UndoSaveReplace(action, data string)

UndoSaveReplace save current state to replace current

func (*SVGView) UpdateGradients

func (sv *SVGView) UpdateGradients(gl []*Gradient)

UpdateGradients update SVG gradients from given gradient list

func (*SVGView) UpdateNodeSprites

func (sv *SVGView) UpdateNodeSprites()

func (*SVGView) UpdateSelSprites

func (sv *SVGView) UpdateSelSprites()

func (*SVGView) UpdateSelect

func (sv *SVGView) UpdateSelect()

UpdateSelect should be called whenever selection changes

func (*SVGView) UpdateVectorEff

func (sv *SVGView) UpdateVectorEff()

UpdateVectorEff updates the GirdEff value based on current scale

func (*SVGView) UpdateView

func (sv *SVGView) UpdateView(full bool)

UpdateView updates the view, optionally with a full re-render

func (*SVGView) VectorDots

func (sv *SVGView) VectorDots() (float32, math32.Vector2)

VectorDots is the current grid spacing and offsets in dots

func (*SVGView) ZoomAt

func (sv *SVGView) ZoomAt(pt image.Point, delta float32)

ZoomAt updates the scale and translate parameters at given point by given delta: + means zoom in, - means zoom out, delta should always be < 1)

func (*SVGView) ZoomToContents

func (sv *SVGView) ZoomToContents(width bool)

ZoomToContents sets the scale to fit the current contents into view

func (*SVGView) ZoomToPage

func (sv *SVGView) ZoomToPage(width bool)

ZoomToPage sets the scale to fit the current viewbox

type SelectedState added in v0.0.2

type SelectedState struct {

	// order item was selected
	Order int

	// initial geometry, saved when first selected or start dragging -- manipulations restore then transform from there
	InitGeom []float32
}

SelectedState is state for selected nodes

type Split

type Split struct {

	// name of splitter config
	Name string

	// brief description
	Desc string

	// splitter panel proportions
	Splits []float32 `min:"0" max:"1" step:".05" fixed-len:"4"`
}

Split is a named splitter configuration

func (Split) Label

func (sp Split) Label() string

Label satisfies the Labeler interface

func (*Split) SaveSplits

func (lt *Split) SaveSplits(sp []float32)

SaveSplits saves given splits to this setting -- must use copy!

type SplitName

type SplitName string

SplitName has an associated ValueView for selecting from the list of available named splits

func (SplitName) Value

func (sn SplitName) Value() views.Value

Value registers SplitValue as the views.Value for SplitName.

type SplitValue

type SplitValue struct {
	views.ValueBase[*core.Button]
}

SplitValue represents a SplitName value with a button.

func (*SplitValue) Config

func (v *SplitValue) Config()

func (*SplitValue) OpenDialog

func (v *SplitValue) OpenDialog(ctx core.Widget, fun func())

func (*SplitValue) Update

func (v *SplitValue) Update()

type Splits

type Splits []*Split

Splits is a list of named splitter configurations

var AvailableSplits Splits

AvailableSplits are available named splitter settings. can be loaded / saved / edited with settings. This is set to StandardSplits at startup.

func (*Splits) Add

func (lt *Splits) Add(name, desc string, splits []float32) (*Split, int)

Add adds a new splitter setting, returns split and index

func (*Splits) CopyFrom

func (lt *Splits) CopyFrom(cp Splits)

CopyFrom copies named splits from given other map

func (*Splits) FixLen

func (lt *Splits) FixLen()

FixLen ensures that there are exactly 4 splits in each

func (*Splits) Names

func (lt *Splits) Names() []string

Names returns a slice of current names

func (*Splits) Open

func (lt *Splits) Open(filename core.Filename) error

Open opens named splits from a json-formatted file.

func (*Splits) OpenSettings

func (lt *Splits) OpenSettings() error

OpenSettings opens Splits from App standard prefs directory, using PrefSplitsFilename

func (*Splits) Save

func (lt *Splits) Save(filename core.Filename) error

Save saves named splits to a json-formatted file.

func (*Splits) SaveSettings added in v0.0.2

func (lt *Splits) SaveSettings() error

SaveSettings saves Splits to App standard prefs directory, using PrefSplitsFilename

func (*Splits) SplitByName

func (lt *Splits) SplitByName(name SplitName) (*Split, int, bool)

SplitByName returns a named split and index by name -- returns false and emits a message to stdout if not found

type Sprites

type Sprites int32 //enums:enum

Sprites are the type of sprite

const (
	// SpUnk is an unknown sprite type
	SpUnk Sprites = iota

	// SpReshapeBBox is a reshape bbox -- the overall active selection BBox
	// for active manipulation
	SpReshapeBBox

	// SpSelBBox is a selection bounding box -- display only
	SpSelBBox

	// SpNodePoint is a main coordinate point for path node
	SpNodePoint

	// SpNodeCtrl is a control coordinate point for path node
	SpNodeCtrl

	// SpRubberBand is the draggable sel box
	// subtyp = UpC, LfM, RtM, DnC for sides
	SpRubberBand

	// SpAlignMatch is an alignment match (n of these),
	// subtyp is actually BBoxPoints so we just hack cast that
	SpAlignMatch

	// Sprite bounding boxes are set as a "bbox" property on sprites
	SpBBoxUpL
	SpBBoxUpC
	SpBBoxUpR
	SpBBoxDnL
	SpBBoxDnC
	SpBBoxDnR
	SpBBoxLfM
	SpBBoxRtM
)
const SpritesN Sprites = 15

SpritesN is the highest valid value for type Sprites, plus one.

func SpriteProperties added in v0.0.2

func SpriteProperties(sp *core.Sprite) (typ, subtyp Sprites, idx int)

SpriteProperties reads the sprite properties -- returns SpUnk if not one of our sprites.

func SpritesValues

func SpritesValues() []Sprites

SpritesValues returns all possible values for the type Sprites.

func (Sprites) Desc

func (i Sprites) Desc() string

Desc returns the description of the Sprites value.

func (Sprites) Int64

func (i Sprites) Int64() int64

Int64 returns the Sprites value as an int64.

func (Sprites) MarshalText

func (i Sprites) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Sprites) SetInt64

func (i *Sprites) SetInt64(in int64)

SetInt64 sets the Sprites value from an int64.

func (*Sprites) SetString

func (i *Sprites) SetString(s string) error

SetString sets the Sprites value from its string representation, and returns an error if the string is invalid.

func (Sprites) String

func (i Sprites) String() string

String returns the string representation of this Sprites value.

func (*Sprites) UnmarshalText

func (i *Sprites) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Sprites) Values

func (i Sprites) Values() []enums.Enum

Values returns all possible values for the type Sprites.

type StandardSizeValues added in v0.0.2

type StandardSizeValues struct {
	Units units.Units
	X     float32
	Y     float32
}

StandardSizeValues are values for standard sizes

type StandardSizes added in v0.0.2

type StandardSizes int32 //enums:enum

StandardSizes are standard physical drawing sizes

const (
	// CustomSize =  nonstandard
	CustomSize StandardSizes = iota

	// Image 1280x720 Px = 720p
	Img1280x720

	// Image 1920x1080 Px = 1080p HD
	Img1920x1080

	// Image 3840x2160 Px = 4K
	Img3840x2160

	// Image 7680x4320 Px = 8K
	Img7680x4320

	// Image 1024x768 Px = XGA
	Img1024x768

	// Image 720x480 Px = DVD
	Img720x480

	// Image 640x480 Px = VGA
	Img640x480

	// Image 320x240 Px = old CRT
	Img320x240

	// A4 = 210 x 297 mm
	A4

	// USLetter = 8.5 x 11 in = 612 x 792 pt
	USLetter

	// USLegal = 8.5 x 14 in = 612 x 1008 pt
	USLegal

	// A0 = 841 x 1189 mm
	A0

	// A1 = 594 x 841 mm
	A1

	// A2 = 420 x 594 mm
	A2

	// A3 = 297 x 420 mm
	A3

	// A5 = 148 x 210 mm
	A5

	// A6 = 105 x 148 mm
	A6

	// A7 = 74 x 105
	A7

	// A8 = 52 x 74 mm
	A8

	// A9 = 37 x 52
	A9

	// A10 = 26 x 37
	A10
)
const StandardSizesN StandardSizes = 22

StandardSizesN is the highest valid value for type StandardSizes, plus one.

func MatchStandardSize added in v0.0.2

func MatchStandardSize(wd, ht float32, un units.Units) StandardSizes

func StandardSizesValues added in v0.0.2

func StandardSizesValues() []StandardSizes

StandardSizesValues returns all possible values for the type StandardSizes.

func (StandardSizes) Desc added in v0.0.2

func (i StandardSizes) Desc() string

Desc returns the description of the StandardSizes value.

func (StandardSizes) Int64 added in v0.0.2

func (i StandardSizes) Int64() int64

Int64 returns the StandardSizes value as an int64.

func (StandardSizes) MarshalText added in v0.0.2

func (i StandardSizes) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*StandardSizes) SetInt64 added in v0.0.2

func (i *StandardSizes) SetInt64(in int64)

SetInt64 sets the StandardSizes value from an int64.

func (*StandardSizes) SetString added in v0.0.2

func (i *StandardSizes) SetString(s string) error

SetString sets the StandardSizes value from its string representation, and returns an error if the string is invalid.

func (StandardSizes) String added in v0.0.2

func (i StandardSizes) String() string

String returns the string representation of this StandardSizes value.

func (*StandardSizes) UnmarshalText added in v0.0.2

func (i *StandardSizes) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (StandardSizes) Values added in v0.0.2

func (i StandardSizes) Values() []enums.Enum

Values returns all possible values for the type StandardSizes.

type TextStyle

type TextStyle struct {

	// current text to edit
	Text string

	// font family
	Font core.FontName `xml:"font-family"`

	// font size
	Size units.Value `xml:"font-size"`

	// prop: font-style = style -- normal, italic, etc
	Style styles.FontStyles `xml:"font-style" inherit:"true"`

	// prop: font-weight = weight: normal, bold, etc
	Weight styles.FontWeights `xml:"font-weight" inherit:"true"`

	// prop: font-stretch = font stretch / condense options
	Stretch styles.FontStretch `xml:"font-stretch" inherit:"true"`

	// prop: font-variant = normal or small caps
	Variant styles.FontVariants `xml:"font-variant" inherit:"true"`

	// prop: text-decoration = underline, line-through, etc -- not inherited
	Deco styles.TextDecorations `xml:"text-decoration"`

	// prop: baseline-shift = super / sub script -- not inherited
	Shift styles.BaselineShifts `xml:"baseline-shift"`

	// prop: text-align (inherited) = how to align text, horizontally. This *only* applies to the text within its containing element, and is typically relevant only for multi-line text: for single-line text, if element does not have a specified size that is different from the text size, then this has *no effect*.
	Align styles.Aligns `xml:"text-align" inherit:"true"`

	// font value view for font toolbar
	FontValue views.FontValue `view:"-"`

	// the parent vectorview
	VectorView *VectorView `copier:"-" json:"-" xml:"-" view:"-"`
}

TextStyle is text styling info -- using StructView to do text editor

func (*TextStyle) Defaults

func (ts *TextStyle) Defaults()

func (*TextStyle) SetFromFontStyle

func (ts *TextStyle) SetFromFontStyle(fs *styles.Font)

SetFromFontStyle sets from standard styles.Font style

func (*TextStyle) SetFromNode

func (ts *TextStyle) SetFromNode(txt *svg.Text)

SetFromNode sets text style info from given svg.Text node

func (*TextStyle) TextProperties added in v0.0.2

func (ts *TextStyle) TextProperties() map[string]string

TextProperties returns non-default text properties to set

func (*TextStyle) Update

func (ts *TextStyle) Update()

type Tools

type Tools int //enums:enum

Tools are the drawing tools

const (
	SelectTool Tools = iota
	NodeTool
	RectTool
	EllipseTool
	BezierTool
	TextTool
)
const ToolsN Tools = 6

ToolsN is the highest valid value for type Tools, plus one.

func ToolsValues

func ToolsValues() []Tools

ToolsValues returns all possible values for the type Tools.

func (Tools) Desc

func (i Tools) Desc() string

Desc returns the description of the Tools value.

func (Tools) Int64

func (i Tools) Int64() int64

Int64 returns the Tools value as an int64.

func (Tools) MarshalText

func (i Tools) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Tools) SetInt64

func (i *Tools) SetInt64(in int64)

SetInt64 sets the Tools value from an int64.

func (*Tools) SetString

func (i *Tools) SetString(s string) error

SetString sets the Tools value from its string representation, and returns an error if the string is invalid.

func (Tools) String

func (i Tools) String() string

String returns the string representation of this Tools value.

func (*Tools) UnmarshalText

func (i *Tools) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Tools) Values

func (i Tools) Values() []enums.Enum

Values returns all possible values for the type Tools.

type TreeView

type TreeView struct {
	views.TreeView

	// the parent vectorview
	VectorView *VectorView `copier:"-" json:"-" xml:"-" view:"-"`
}

TreeView is a TreeView that knows how to operate on FileNode nodes

func NewTreeView

func NewTreeView(parent tree.Node, name ...string) *TreeView

NewTreeView adds a new TreeView with the given name to the given parent: TreeView is a TreeView that knows how to operate on FileNode nodes

func (*TreeView) LayerClearCurrent

func (tv *TreeView) LayerClearCurrent()

LayerClearCurrent clears this layer as the current layer if it was set as such.

func (*TreeView) LayerIsCurrent

func (tv *TreeView) LayerIsCurrent() bool

LayerIsCurrent returns true if layer is the current active one for creating

func (*TreeView) LayerSetCurrent

func (tv *TreeView) LayerSetCurrent()

LayerSetCurrent sets this layer as the current layer name

func (*TreeView) LayerToggleLock

func (tv *TreeView) LayerToggleLock()

LayerToggleLock toggles whether layer is locked or not

func (*TreeView) LayerToggleVis

func (tv *TreeView) LayerToggleVis()

LayerToggleVis toggles visibility of the layer

func (*TreeView) New

func (t *TreeView) New() tree.Node

New returns a new *TreeView value

func (*TreeView) NodeType added in v0.0.2

func (t *TreeView) NodeType() *types.Type

NodeType returns the *types.Type of TreeView

func (*TreeView) SelectSVG

func (tv *TreeView) SelectSVG()

SelectSVG

func (*TreeView) SetIcon

func (t *TreeView) SetIcon(v icons.Icon) *TreeView

SetIcon sets the [TreeView.Icon]

func (*TreeView) SetIconClosed

func (t *TreeView) SetIconClosed(v icons.Icon) *TreeView

SetIconClosed sets the [TreeView.IconClosed]

func (*TreeView) SetIconLeaf

func (t *TreeView) SetIconLeaf(v icons.Icon) *TreeView

SetIconLeaf sets the [TreeView.IconLeaf]

func (*TreeView) SetIconOpen

func (t *TreeView) SetIconOpen(v icons.Icon) *TreeView

SetIconOpen sets the [TreeView.IconOpen]

func (*TreeView) SetIndent

func (t *TreeView) SetIndent(v units.Value) *TreeView

SetIndent sets the [TreeView.Indent]

func (*TreeView) SetOpenDepth

func (t *TreeView) SetOpenDepth(v int) *TreeView

SetOpenDepth sets the [TreeView.OpenDepth]

func (*TreeView) SetRootView

func (t *TreeView) SetRootView(v *views.TreeView) *TreeView

SetRootView sets the [TreeView.RootView]

func (*TreeView) SetSelectedNodes

func (t *TreeView) SetSelectedNodes(v ...views.TreeViewer) *TreeView

SetSelectedNodes sets the [TreeView.SelectedNodes]

func (*TreeView) SetText

func (t *TreeView) SetText(v string) *TreeView

SetText sets the [TreeView.Text]

func (*TreeView) SetTooltip

func (t *TreeView) SetTooltip(v string) *TreeView

SetTooltip sets the [TreeView.Tooltip]

func (*TreeView) SetVectorView

func (t *TreeView) SetVectorView(v *VectorView) *TreeView

SetVectorView sets the [TreeView.VectorView]: the parent vectorview

func (*TreeView) SetViewIndex added in v0.0.2

func (t *TreeView) SetViewIndex(v int) *TreeView

SetViewIndex sets the [TreeView.ViewIndex]

func (*TreeView) SetWidgetSize

func (t *TreeView) SetWidgetSize(v math32.Vector2) *TreeView

SetWidgetSize sets the [TreeView.WidgetSize]

type VectorView

type VectorView struct {
	core.Frame

	// full path to current drawing filename
	Filename core.Filename `ext:".svg" set:"-"`

	// current edit state
	EditState EditState `set:"-"`
}

VectorView is the Vector SVG vector drawing program

func NewDrawing

func NewDrawing(sz PhysSize) *VectorView

NewDrawing opens a new drawing window

func NewVectorView

func NewVectorView(parent tree.Node, name ...string) *VectorView

NewVectorView adds a new VectorView with the given name to the given parent: VectorView is the Vector SVG vector drawing program

func NewVectorWindow

func NewVectorWindow(fnm string) *VectorView

NewVectorWindow returns a new VectorWindow loading given file if non-empty

func (*VectorView) AddCloseDialog

func (vv *VectorView) AddCloseDialog()

AddCloseDialog adds the close dialog that prompts the user to save the file when they try to close the scene containing this vector view.

func (*VectorView) AddImage

func (vv *VectorView) AddImage(fname core.Filename, width, height float32) error

AddImage adds a new image node set to the given image

func (*VectorView) AddLayer

func (vv *VectorView) AddLayer()

AddLayer adds a new layer

func (*VectorView) Align

func (vv *VectorView) Align(aa AlignAnchors, al Aligns)

func (*VectorView) AlignAnchorBBox

func (vv *VectorView) AlignAnchorBBox(aa AlignAnchors) (image.Rectangle, svg.Node)

AlignAnchorBBox returns the bounding box for given type of align anchor and the anchor node if non-nil

func (*VectorView) AlignCenter

func (vv *VectorView) AlignCenter(aa AlignAnchors, dim math32.Dims, act string)

func (*VectorView) AlignMax

func (vv *VectorView) AlignMax(aa AlignAnchors, dim math32.Dims, act string)

func (*VectorView) AlignMaxAnchor

func (vv *VectorView) AlignMaxAnchor(aa AlignAnchors, dim math32.Dims, act string)

func (*VectorView) AlignMin

func (vv *VectorView) AlignMin(aa AlignAnchors, dim math32.Dims, act string)

AlignMin aligns to min coordinate (Left, Top) in bbox

func (*VectorView) AlignMinAnchor

func (vv *VectorView) AlignMinAnchor(aa AlignAnchors, dim math32.Dims, act string)

func (*VectorView) AutoSave

func (vv *VectorView) AutoSave() error

AutoSave does the autosave -- safe to call in a separate goroutine

func (*VectorView) AutoSaveCheck

func (vv *VectorView) AutoSaveCheck() bool

AutoSaveCheck checks if an autosave file exists -- logic for dealing with it is left to larger app -- call this before opening a file

func (*VectorView) AutoSaveDelete

func (vv *VectorView) AutoSaveDelete()

AutoSaveDelete deletes any existing autosave file

func (*VectorView) AutoSaveFilename

func (vv *VectorView) AutoSaveFilename() string

AutoSaveFilename returns the autosave filename

func (*VectorView) ChangeMade

func (vv *VectorView) ChangeMade()

ChangeMade should be called after any change is completed on the drawing. Calls autosave.

func (*VectorView) ClearCurLayer

func (vv *VectorView) ClearCurLayer(lay string)

ClearCurLayer clears the current layer for creating items if it was set to the given layer name

func (*VectorView) Config

func (vv *VectorView) Config()

Config configures entire view -- only runs if no children yet

func (*VectorView) ConfigModalToolbar

func (vv *VectorView) ConfigModalToolbar()

func (*VectorView) ConfigNodeToolbar

func (vv *VectorView) ConfigNodeToolbar()

ConfigNodeToolbar configures the node modal toolbar (default tooblar)

func (*VectorView) ConfigSelectToolbar

func (gv *VectorView) ConfigSelectToolbar()

ConfigSelectToolbar configures the selection modal toolbar (default toolbar)

func (*VectorView) ConfigStatusBar

func (vv *VectorView) ConfigStatusBar()

ConfigStatusBar configures statusbar with label

func (*VectorView) ConfigTabs

func (vv *VectorView) ConfigTabs()

func (*VectorView) ConfigTextToolbar

func (gv *VectorView) ConfigTextToolbar()

ConfigTextToolbar configures the text modal toolbar

func (*VectorView) ConfigToolbar

func (vv *VectorView) ConfigToolbar(tb *core.Toolbar)

func (*VectorView) ConfigTools

func (gv *VectorView) ConfigTools()

func (*VectorView) CopySelected

func (gv *VectorView) CopySelected()

CopySelected copies selected items in SVG view, using TreeView methods

func (*VectorView) CutSelected

func (gv *VectorView) CutSelected()

CutSelected cuts selected items in SVG view, using TreeView methods

func (*VectorView) DefaultGradient

func (vv *VectorView) DefaultGradient() string

DefaultGradient returns the default gradient to use for setting stops

func (*VectorView) DeleteSelected

func (gv *VectorView) DeleteSelected()

DeleteSelected deletes selected items in SVG view, using TreeView methods

func (*VectorView) DuplicateSelected

func (gv *VectorView) DuplicateSelected()

DuplicateSelected duplicates selected items in SVG view, using TreeView methods

func (*VectorView) EditRecents

func (vv *VectorView) EditRecents()

RecentsEdit opens a dialog editor for deleting from the recents project list

func (*VectorView) ExportPDF

func (vv *VectorView) ExportPDF(dpi float32) error

ExportPDF exports drawing to a PDF file (auto-names to same name with .pdf suffix). Calls inkscape -- needs to be on the PATH. specify DPI of resulting image for effects rendering. Renders full current page -- do ResizeToContents to render just current contents.

func (*VectorView) ExportPNG

func (vv *VectorView) ExportPNG(width, height float32) error

ExportPNG exports drawing to a PNG image (auto-names to same name with .png suffix). Calls inkscape -- needs to be on the PATH. specify either width or height of resulting image, or nothing for physical size as set. Renders full current page -- do ResizeToContents to render just current contents.

func (*VectorView) FirstLayerIndex

func (vv *VectorView) FirstLayerIndex() int

FirstLayerIndex returns index of first layer group in svg

func (*VectorView) HBox

func (vv *VectorView) HBox() *core.Frame

func (*VectorView) HelpWiki

func (vv *VectorView) HelpWiki()

HelpWiki opens wiki page for grid on github

func (*VectorView) IsConfiged

func (vv *VectorView) IsConfiged() bool

IsConfiged returns true if the view is fully configured

func (*VectorView) IsCurLayer

func (vv *VectorView) IsCurLayer(lay string) bool

IsCurLayer returns true if given layer is the current layer for creating items

func (*VectorView) LayerTree

func (vv *VectorView) LayerTree() *core.Layout

func (*VectorView) LayerView

func (vv *VectorView) LayerView() *views.TableView

func (*VectorView) LayerViewSigs

func (vv *VectorView) LayerViewSigs(lyv *views.TableView)

func (*VectorView) ManipAction

func (vv *VectorView) ManipAction(act, data string, manip bool, fun func(sii svg.Node))

ManipAction manages all the updating etc associated with performing an action that includes an ongoing manipulation with a final non-manip update. runs given function to actually do the update.

func (*VectorView) ManipActionFun

func (vv *VectorView) ManipActionFun(sii svg.Node, fun func(itm svg.Node))

func (*VectorView) ModalToolbarStack

func (vv *VectorView) ModalToolbarStack() *core.Layout

func (*VectorView) New

func (t *VectorView) New() tree.Node

New returns a new *VectorView value

func (*VectorView) NewDrawing

func (vv *VectorView) NewDrawing(sz PhysSize) *VectorView

NewDrawing creates a new drawing of the given size

func (*VectorView) NewSelectFuncButton

func (gv *VectorView) NewSelectFuncButton(parent tree.Node, fun any) *views.FuncButton

NewSelectFuncButton returns a new func button that is only enabled when there is an item selected.

func (*VectorView) NodeEnableFunc

func (vv *VectorView) NodeEnableFunc(act *core.Button)

NodeEnableFunc is an ActionUpdateFunc that inactivates action if no node selected

func (*VectorView) NodeSetXPos

func (vv *VectorView) NodeSetXPos(xp float32)

func (*VectorView) NodeSetYPos

func (vv *VectorView) NodeSetYPos(yp float32)

func (*VectorView) NodeToolbar

func (vv *VectorView) NodeToolbar() *core.Toolbar

func (*VectorView) NodeType added in v0.0.2

func (t *VectorView) NodeType() *types.Type

NodeType returns the *types.Type of VectorView

func (*VectorView) OnAdd

func (vv *VectorView) OnAdd()

func (*VectorView) OnInit

func (vv *VectorView) OnInit()

func (*VectorView) OpenDrawing

func (vv *VectorView) OpenDrawing(fnm core.Filename) error

OpenDrawing opens a new .svg drawing

func (*VectorView) OpenDrawingFile

func (vv *VectorView) OpenDrawingFile(fnm core.Filename) error

OpenDrawingFile opens a new .svg drawing file -- just the basic opening

func (*VectorView) OpenRecent

func (vv *VectorView) OpenRecent(filename core.Filename)

OpenRecent opens a recently-used file

func (*VectorView) PaintView

func (vv *VectorView) PaintView() *PaintView

func (*VectorView) PasteAvailFunc

func (vv *VectorView) PasteAvailFunc(bt *core.Button)

PasteAvailFunc is an ActionUpdateFunc that inactivates action if no paste avail

func (*VectorView) PasteClip

func (gv *VectorView) PasteClip()

PasteClip pastes clipboard, using cur layer etc

func (*VectorView) PromptPhysSize

func (vv *VectorView) PromptPhysSize()

PromptPhysSize prompts for the physical size of the drawing and sets it

func (*VectorView) RecycleTab

func (gv *VectorView) RecycleTab(label string, sel bool) *core.Frame

RecycleTab returns the tab with given the name, first by looking for an existing one, and if not found, making a new one. If sel, then select it.

func (*VectorView) Redo

func (vv *VectorView) Redo() string

Redo redoes the previously undone action

func (*VectorView) ResizeToContents

func (vv *VectorView) ResizeToContents()

ResizeToContents resizes the drawing to just fit the current contents, including moving everything to start at upper-left corner, preserving the current grid offset, so grid snapping is preserved.

func (*VectorView) SSVG

func (vv *VectorView) SSVG() *svg.SVG

SSVG returns the underlying svg.SVG.

func (*VectorView) SVG

func (vv *VectorView) SVG() *SVGView

SVG returns the SVGView.

func (*VectorView) SaveDrawing

func (vv *VectorView) SaveDrawing() error

SaveDrawing saves .svg drawing to current filename

func (*VectorView) SaveDrawingAs

func (vv *VectorView) SaveDrawingAs(fname core.Filename) error

SaveDrawingAs saves .svg drawing to given filename

func (*VectorView) SelectFlipHorizontal added in v0.0.2

func (gv *VectorView) SelectFlipHorizontal()

SelectFlipHorizontal flips the selection horizontally

func (*VectorView) SelectFlipVertical added in v0.0.2

func (gv *VectorView) SelectFlipVertical()

SelectFlipVertical flips the selection vertically

func (*VectorView) SelectGroup added in v0.0.2

func (gv *VectorView) SelectGroup()

SelectGroup groups items together

func (*VectorView) SelectLower added in v0.0.2

func (gv *VectorView) SelectLower()

SelectLower lowers the selection by one level in the layer

func (*VectorView) SelectLowerBottom added in v0.0.2

func (gv *VectorView) SelectLowerBottom()

SelectLowerBottom lowers the selection to the bottom of the layer

func (*VectorView) SelectNodeInSVG

func (vv *VectorView) SelectNodeInSVG(kn tree.Node, mode events.SelectModes)

SelectNodeInSVG selects given svg node in SVG drawing

func (*VectorView) SelectNodeInTree

func (gv *VectorView) SelectNodeInTree(kn tree.Node, mode events.SelectModes)

SelectNodeInTree selects given node in TreeView

func (*VectorView) SelectRaise added in v0.0.2

func (gv *VectorView) SelectRaise()

SelectRaise raises the selection by one level in the layer

func (*VectorView) SelectRaiseTop added in v0.0.2

func (gv *VectorView) SelectRaiseTop()

SelectRaiseTop raises the selection to the top of the layer

func (*VectorView) SelectRotate added in v0.0.2

func (gv *VectorView) SelectRotate(deg float32)

func (*VectorView) SelectRotateLeft added in v0.0.2

func (gv *VectorView) SelectRotateLeft()

SelectRotateLeft rotates the selection 90 degrees counter-clockwise

func (*VectorView) SelectRotateRight added in v0.0.2

func (gv *VectorView) SelectRotateRight()

SelectRotateRight rotates the selection 90 degrees clockwise

func (*VectorView) SelectScale added in v0.0.2

func (gv *VectorView) SelectScale(scx, scy float32)

func (*VectorView) SelectSetHeight added in v0.0.2

func (gv *VectorView) SelectSetHeight(ht float32)

func (*VectorView) SelectSetWidth added in v0.0.2

func (gv *VectorView) SelectSetWidth(wd float32)

func (*VectorView) SelectSetXPos added in v0.0.2

func (gv *VectorView) SelectSetXPos(xp float32)

func (*VectorView) SelectSetYPos added in v0.0.2

func (gv *VectorView) SelectSetYPos(yp float32)

func (*VectorView) SelectToolbar

func (gv *VectorView) SelectToolbar() *core.Toolbar

func (*VectorView) SelectUnGroup added in v0.0.2

func (gv *VectorView) SelectUnGroup()

SelectUnGroup ungroups items from each other

func (*VectorView) SelectedAsTreeViews

func (gv *VectorView) SelectedAsTreeViews() []views.TreeViewer

SelectedAsTreeViews returns the currently-selected items from SVG as TreeView nodes

func (*VectorView) SetColorNode

func (vv *VectorView) SetColorNode(sii svg.Node, prop string, prev, pt PaintTypes, sp string)

SetColorNode sets the color properties of Node based on previous and current PaintType

func (*VectorView) SetCurLayer

func (vv *VectorView) SetCurLayer(lay string)

SetCurLayer sets the current layer for creating items to given one

func (*VectorView) SetDashNode

func (vv *VectorView) SetDashNode(sii svg.Node, dary []float64)

SetDashNode sets the stroke-dasharray property of Node. multiplies dash values by the line width in dots.

func (*VectorView) SetDashProperties added in v0.0.2

func (vv *VectorView) SetDashProperties(dary []float64)

SetDashProperties sets the dash properties

func (*VectorView) SetDefaultStyle

func (vv *VectorView) SetDefaultStyle()

func (*VectorView) SetFill

func (vv *VectorView) SetFill(prev, pt PaintTypes, fp string)

SetFill sets the fill properties of selected items based on previous and current PaintType

func (*VectorView) SetFillColor

func (vv *VectorView) SetFillColor(fp string, manip bool)

SetFillColor sets the fill color for selected items manip means currently being manipulated -- don't save undo.

func (*VectorView) SetMarkerNode

func (vv *VectorView) SetMarkerNode(sii svg.Node, start, mid, end string, sc, mc, ec MarkerColors)

SetMarkerNode sets the marker properties of Node.

func (*VectorView) SetMarkerProperties added in v0.0.2

func (vv *VectorView) SetMarkerProperties(start, mid, end string, sc, mc, ec MarkerColors)

SetMarkerProperties sets the marker properties

func (*VectorView) SetModalNode

func (vv *VectorView) SetModalNode()

SetModalNode sets the modal toolbar to be the node editing one

func (*VectorView) SetModalSelect

func (vv *VectorView) SetModalSelect()

SetModalSelect sets the modal toolbar to be the select one

func (*VectorView) SetModalText

func (vv *VectorView) SetModalText()

SetModalText sets the modal toolbar to be the text editing one

func (*VectorView) SetModalToolbar

func (gv *VectorView) SetModalToolbar()

SetModalToolbar sets the current modal toolbar based on tool

func (*VectorView) SetPhysSize

func (vv *VectorView) SetPhysSize(sz *PhysSize)

SetPhysSize sets physical size of drawing

func (*VectorView) SetStatus

func (vv *VectorView) SetStatus(msg string)

SetStatus updates the statusbar label with given message, along with other status info

func (*VectorView) SetStroke

func (vv *VectorView) SetStroke(prev, pt PaintTypes, sp string)

SetStroke sets the stroke properties of selected items based on previous and current PaintType

func (*VectorView) SetStrokeColor

func (vv *VectorView) SetStrokeColor(sp string, manip bool)

SetStrokeColor sets the stroke color for selected items. manip means currently being manipulated -- don't save undo.

func (*VectorView) SetStrokeWidth

func (vv *VectorView) SetStrokeWidth(wp string, manip bool)

SetStrokeWidth sets the stroke width property for selected items manip means currently being manipulated -- don't save undo.

func (*VectorView) SetStrokeWidthNode

func (vv *VectorView) SetStrokeWidthNode(sii svg.Node, wp string)

SetStrokeWidthNode sets the stroke width of Node

func (*VectorView) SetStyles

func (vv *VectorView) SetStyles()

func (*VectorView) SetText

func (gv *VectorView) SetText(txt string)

SetText sets the text of selected Text node

func (*VectorView) SetTextNode

func (gv *VectorView) SetTextNode(sii svg.Node, txt string) bool

SetTextNode sets the text of given Text node

func (*VectorView) SetTextProperties added in v0.0.2

func (gv *VectorView) SetTextProperties(tps map[string]string)

SetTextProperties sets the text properties of selected Text nodes

func (*VectorView) SetTextPropertiesNode added in v0.0.2

func (gv *VectorView) SetTextPropertiesNode(sii svg.Node, tps map[string]string)

SetTextPropertiesNode sets the text properties of given Text node

func (*VectorView) SetTitle

func (vv *VectorView) SetTitle()

func (*VectorView) SetTool

func (gv *VectorView) SetTool(tl Tools)

SetTool sets the current active tool

func (*VectorView) SetTooltip

func (t *VectorView) SetTooltip(v string) *VectorView

SetTooltip sets the [VectorView.Tooltip]

func (*VectorView) Splits

func (vv *VectorView) Splits() *core.Splits

func (*VectorView) SplitsEdit

func (vv *VectorView) SplitsEdit()

SplitsEdit opens the SplitsView editor to customize saved splitter settings

func (*VectorView) SplitsSave

func (vv *VectorView) SplitsSave(split SplitName)

SplitsSave saves current splitter settings to named splitter settings under existing name, and saves to prefs file

func (*VectorView) SplitsSaveAs

func (vv *VectorView) SplitsSaveAs(name, desc string)

SplitsSaveAs saves current splitter settings to new named splitter settings, and saves to prefs file

func (*VectorView) SplitsSetView

func (vv *VectorView) SplitsSetView(split SplitName)

SplitsSetView sets split view splitters to given named setting

func (*VectorView) StatusBar

func (vv *VectorView) StatusBar() *core.Frame

StatusBar returns the statusbar widget

func (*VectorView) StatusLabel

func (vv *VectorView) StatusLabel() *core.Label

StatusLabel returns the statusbar label widget

func (*VectorView) SyncLayers

func (vv *VectorView) SyncLayers()

func (*VectorView) Tab

func (gv *VectorView) Tab(label string) *core.Frame

Tab returns the tab with the given label

func (*VectorView) Tabs

func (vv *VectorView) Tabs() *core.Tabs

func (*VectorView) TextToolbar

func (gv *VectorView) TextToolbar() *core.Toolbar

func (*VectorView) Tools

func (vv *VectorView) Tools() *core.Toolbar

func (*VectorView) TreeView

func (vv *VectorView) TreeView() *TreeView

func (*VectorView) Undo

func (vv *VectorView) Undo() string

Undo undoes the last action

func (*VectorView) UpdateAll

func (vv *VectorView) UpdateAll()

UpdateAll updates the display

func (*VectorView) UpdateDisp

func (vv *VectorView) UpdateDisp()

func (*VectorView) UpdateGradients

func (vv *VectorView) UpdateGradients()

UpdateGradients updates gradients from EditState

func (*VectorView) UpdateLayerView

func (vv *VectorView) UpdateLayerView()

func (*VectorView) UpdateMarkerColors

func (vv *VectorView) UpdateMarkerColors(sii svg.Node)

UpdateMarkerColors updates the marker colors, when setting fill or stroke

func (*VectorView) UpdateNodeToolbar

func (vv *VectorView) UpdateNodeToolbar()

UpdateNodeToolbar updates the node toolbar based on current nodeion

func (*VectorView) UpdateSelectToolbar

func (gv *VectorView) UpdateSelectToolbar()

UpdateSelectToolbar updates the select toolbar based on current selection

func (*VectorView) UpdateTabs

func (vv *VectorView) UpdateTabs()

func (*VectorView) UpdateTextToolbar

func (gv *VectorView) UpdateTextToolbar()

UpdateTextToolbar updates the select toolbar based on current selection

func (*VectorView) UpdateTreeView

func (vv *VectorView) UpdateTreeView()

type VectorViewFlags

type VectorViewFlags core.WidgetFlags //enums:bitflag -trim-prefix VectorViewFlag

VectorViewFlags extend WidgetFlags to hold VectorView state

const (
	// VectorViewAutoSaving means
	VectorViewAutoSaving VectorViewFlags = VectorViewFlags(core.WidgetFlagsN) + iota
)
const VectorViewFlagsN VectorViewFlags = 3

VectorViewFlagsN is the highest valid value for type VectorViewFlags, plus one.

func VectorViewFlagsValues

func VectorViewFlagsValues() []VectorViewFlags

VectorViewFlagsValues returns all possible values for the type VectorViewFlags.

func (VectorViewFlags) BitIndexString

func (i VectorViewFlags) BitIndexString() string

BitIndexString returns the string representation of this VectorViewFlags value if it is a bit index value (typically an enum constant), and not an actual bit flag value.

func (VectorViewFlags) Desc

func (i VectorViewFlags) Desc() string

Desc returns the description of the VectorViewFlags value.

func (VectorViewFlags) HasFlag

func (i VectorViewFlags) HasFlag(f enums.BitFlag) bool

HasFlag returns whether these bit flags have the given bit flag set.

func (VectorViewFlags) Int64

func (i VectorViewFlags) Int64() int64

Int64 returns the VectorViewFlags value as an int64.

func (VectorViewFlags) MarshalText

func (i VectorViewFlags) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*VectorViewFlags) SetFlag

func (i *VectorViewFlags) SetFlag(on bool, f ...enums.BitFlag)

SetFlag sets the value of the given flags in these flags to the given value.

func (*VectorViewFlags) SetInt64

func (i *VectorViewFlags) SetInt64(in int64)

SetInt64 sets the VectorViewFlags value from an int64.

func (*VectorViewFlags) SetString

func (i *VectorViewFlags) SetString(s string) error

SetString sets the VectorViewFlags value from its string representation, and returns an error if the string is invalid.

func (*VectorViewFlags) SetStringOr

func (i *VectorViewFlags) SetStringOr(s string) error

SetStringOr sets the VectorViewFlags value from its string representation while preserving any bit flags already set, and returns an error if the string is invalid.

func (VectorViewFlags) String

func (i VectorViewFlags) String() string

String returns the string representation of this VectorViewFlags value.

func (*VectorViewFlags) UnmarshalText

func (i *VectorViewFlags) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (VectorViewFlags) Values

func (i VectorViewFlags) Values() []enums.Enum

Values returns all possible values for the type VectorViewFlags.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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