A | |
addCommandToHistory, SvgCanvas | |
addSubCommand, SvgCanvas. | |
addSvgElementFromJson, SelectorManager | |
addToSelection, SelectorManager | |
apply | |
assignAttributes, SelectorManager | |
B | |
BatchCommand, SvgCanvas | |
beginUndoableChange, SvgCanvas | |
bind, SelectorManager | |
C | |
ChangeElementCommand, SvgCanvas | |
cleanupElement, SelectorManager | |
clear, pathActions | |
clearSelection, SelectorManager | |
convertToNum, SvgCanvas | |
convertToPath, pathActions | |
createLayer, pathActions | |
D | |
deleteCurrentLayer, pathActions | |
E | |
elements | |
embedImage, pathActions | |
F | |
finishUndoableChange, SvgCanvas | |
fromXml, SvgCanvas | |
G | |
getContentElem, pathActions | |
getCurrentLayer, pathActions | |
getDocumentTitle, pathActions | |
getId, SelectorManager | |
getLayer, pathActions | |
getLayerOpacity, pathActions | |
getLayerVisibility, pathActions | |
getMatrix, SelectorManager | |
getMouseTarget, SelectorManager | |
getNextId, SelectorManager | |
getNextRedoCommandText, SvgCanvas. | |
getNextUndoCommandText, SvgCanvas. | |
getNumLayers, pathActions | |
getRedoStackSize, SvgCanvas. | |
getResolution, pathActions | |
getRootElem, pathActions | |
getRubberBandBox, SelectorManager. | |
getSelectedElems, pathActions | |
getSvgString, pathActions | |
getUndoStackSize, SvgCanvas. | |
getUrlFromAttr, SelectorManager | |
getVersion, pathActions | |
H | |
hasMatrixTransform, SelectorManager | |
I | |
identifyLayers, pathActions | |
importSvgString, pathActions | |
initGroup, SelectorManager. | |
InsertElementCommand, SvgCanvas | |
isEmpty, SvgCanvas. | |
isIdentity, SelectorManager | |
isValidUnit, SvgCanvas | |
L | |
linkControlPoints, pathActions | |
M | |
matrixMultiply, SelectorManager | |
MoveElementCommand, SvgCanvas | |
moveSelectedToLayer, pathActions | |
R | |
rasterExport, pathActions | |
recalculateAllSelectedDimensions, SelectorManager | |
recalculateDimensions, SelectorManager | |
redo, SvgCanvas. | |
releaseSelector, SelectorManager. | |
remapElement, SelectorManager | |
RemoveElementCommand, SvgCanvas | |
removeFromSelection, SelectorManager | |
removeUnusedDefElems, pathActions | |
renameCurrentLayer, pathActions | |
requestSelector, SelectorManager. | |
reset, Selector. | |
resetUndoStack, SvgCanvas | |
resize, Selector. |
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
Create a new SVG element based on the given object keys/values and add it to the current layer The element will be ran through cleanupElement before being returned
var addSvgElementFromJson = this.addSvgElementFromJson = function( data )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Assigns multiple attributes to an element.
var assignAttributes = this.assignAttributes = function( node, attrs, suspendLength, unitCheck )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
Attaches a callback function to an event
c.bind = function( event, f )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
Remove unneeded (default) attributes, makes resulting SVG smaller
var cleanupElement = this.cleanupElement = function( element )
Clears the current document.
this.clear = function()
Clears the selection.
this.clearSelection = function( noCall )
Converts given values to numbers.
convertToNum = function( attr, val )
Convert selected element to a path, or get the BBox of an element-as-path
this.convertToPath = function( elem, getBBox )
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
this.createLayer = function( name )
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Converts a given image file to a data URL when possible, then runs a given callback
this.embedImage = function( val, callback )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Converts XML entities in a string to single characters.
fromXml = function( str )
Returns the content DOM element
this.getContentElem = function()
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Returns the current document title or an empty string if not found
this.getDocumentTitle = function()
Returns the last created DOM element ID string
getId = c.getId = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Get the matrix object for a given element
var getMatrix = function( elem )
Gets the desired element from a mouse event
var getMouseTarget = this.getMouseTarget = function( evt )
Creates and returns a unique ID string for a DOM element
getNextId = c.getNextId = function()
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns the current dimensions and zoom level in an object
this.getResolution = function()
Returns the root DOM element
this.getRootElem = function()
Returns the array with selected DOM elements
this.getSelectedElems = function()
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
Extracts the URL from the url(...)
var getUrlFromAttr = this.getUrlFromAttr = function( attrVal )
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
See if the given transformlist includes a non-indentity matrix transform
var hasMatrixTransform = this.hasMatrixTransform = function( tlist )
Updates layer system
var identifyLayers = function()
This function imports the input SVG XML into the current layer in the drawing
this.importSvgString = function( xmlString )
History command for an element that was added to the DOM
var InsertElementCommand = this.undoCmd.insertElement = function( elem, text )
Helper function to check if the matrix performs no actual transform (i.e.
var isIdentity = function( m )
Check if an attribute’s value is in a valid format
canvas.isValidUnit = function( attr, val )
This function tries to return a SVGMatrix that is the multiplication m1*m2.
var matrixMultiply = this.matrixMultiply = function()
History command for an element that had its DOM position changed
var MoveElementCommand = this.undoCmd.moveElement = function( elem, oldNextSibling, oldParent, text )
Moves the selected elements to layername.
this.moveSelectedToLayer = function( layername )
Generates a PNG Data URL based on the current image, then calls “exported” with an object including the string and any issues found
this.rasterExport = function()
Runs recalculateDimensions on the selected elements, adding the changes to a single batch command
var recalculateAllSelectedDimensions = this.recalculateAllSelectedDimensions = function()
Decides the course of action based on the element’s transform list
var recalculateDimensions = this.recalculateDimensions = function( selected )
Applies coordinate changes to an element based on the given matrix
var remapElement = this.remapElement = function( selected, changes, m )
History command for an element removed from the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function( elem, parent, text )
Removes elements from the selection.
this.removeFromSelection = function( elemsToRemove )
Looks at DOM elements inside the defs to see if they are referred to, removes them from the DOM if they are not.
var removeUnusedDefElems = this.removeUnusedDefElems = function()
Renames the current layer.
this.renameCurrentLayer = function( newname )
Resets the undo stack, effectively clearing the undo/redo history
resetUndoStack = function()