Class CanvasGraphics
CanvasGraphics is a fallback drawing api used for basic drawing operations when SVG is not available.
Properties
node
- private object
Reference to the node for the graphics object
Methods
private
_createGraphicNode
(
type
,
pe
)
Creates a graphic node
- Parameters:
-
type
<String>
node type to create
-
pe
<String>
specified pointer-events value
- Returns:
- HTMLElement
private
void
_removeChildren
(
node
)
Removes all child nodes.
- Parameters:
-
node
<HTMLElement>
private
void
_trackSize
(
w
,
h
)
Updates the size of the graphics object
- Parameters:
-
w
<Number>
width
-
h
<Number>
height
void
destroy
(
)
Removes all nodes.
void
render
(
parentNode
)
Adds the graphics node to the dom.
- Parameters:
-
parentNode
<HTMLElement>
node in which to render the graphics node into.
void
setPosition
(
x
,
y
)
Sets the positon of the graphics object.
- Parameters:
-
x
<Number>
x-coordinate for the object.
-
y
<Number>
y-coordinate for the object.
void
setSize
(
w
,
h
)
Sets the size of the graphics object.
- Parameters:
-
w
<Number>
width to set for the instance.
-
h
<Number>
height to set for the instance.
void
toggleVisible
(
val
)
Shows and and hides a the graphic instance.
- Parameters:
-
val
<Boolean>
indicates whether the instance should be visible.