graphics/js/CanvasDrawing.js:24
Canvas implementation of the Drawing
class.
CanvasDrawing
is not intended to be used directly. Instead, use the Drawing
class.
If the browser lacks SVG capabilities but has
Canvas capabilities, the Drawing
class will point to the CanvasDrawing
class.
_clearAndUpdateCoords
Defined in
graphics/js/CanvasDrawing.js:153
Clears the coordinate arrays. Called at the end of a drawing operation.
_createGraphic
Defined in
graphics/js/CanvasDrawing.js:946
Creates canvas element
HTMLCanvasElement
_curveTo
args
relative
Defined in
graphics/js/CanvasDrawing.js:361
Implements curveTo methods.
_getLinearGradient
Defined in
graphics/js/CanvasDrawing.js:744
Returns a linear gradient fill
CanvasGradient
_getRadialGradient
Defined in
graphics/js/CanvasDrawing.js:824
Returns a radial gradient fill
CanvasGradient
_lineTo
args
relative
Defined in
graphics/js/CanvasDrawing.js:225
Implements lineTo methods.
_moveTo
args
relative
Defined in
graphics/js/CanvasDrawing.js:305
Implements moveTo methods.
_quadraticCurveTo
args
relative
Defined in
graphics/js/CanvasDrawing.js:441
Implements quadraticCurveTo methods.
_setCurveBoundingBox
Array
Number
Number
Defined in
graphics/js/CanvasDrawing.js:986
Calculates the bounding box for a curve
_toRGB
val
Defined in
graphics/js/CanvasDrawing.js:102
Converts color to rgb format
val
Object
Color value to convert.
_toRGBA
val
alpha
Defined in
graphics/js/CanvasDrawing.js:78
Parses hex color string and alpha value to rgba
_trackSize
w
h
Defined in
graphics/js/CanvasDrawing.js:1022
Updates the size of the graphics object
_updateCoords
x
y
Defined in
graphics/js/CanvasDrawing.js:137
Tracks coordinates. Used to calculate the start point of dashed lines.
_updateDrawingQueue
val
Defined in
graphics/js/CanvasDrawing.js:182
Queues up a method to be executed when a shape redraws.
val
Array
An array containing data that can be parsed into a method and arguments. The value at zero-index
of the array is a string reference of the drawing method that will be called. All subsequent indices are argument for
that method. For example, lineTo(10, 100)
would be structured as:
["lineTo", 10, 100]
.
_updateNodePosition
Defined in
graphics/js/CanvasDrawing.js:166
Moves the shape's dom node.
curveTo
cp1x
cp1y
cp2x
cp2y
x
y
Defined in
graphics/js/CanvasDrawing.js:327
Draws a bezier curve.
drawCircle
x
y
r
Defined in
graphics/js/CanvasDrawing.js:486
Draws a circle. Used internally by CanvasCircle
class.
drawDiamond
x
y
width
height
Defined in
graphics/js/CanvasDrawing.js:510
Draws a diamond.
drawEllipse
x
y
w
h
Defined in
graphics/js/CanvasDrawing.js:533
Draws an ellipse. Used internally by CanvasEllipse
class.
drawRect
x
y
w
h
ew
eh
Defined in
graphics/js/CanvasDrawing.js:596
Draws a rectangle with rounded corners.
drawWedge
x
y
startAngle
arc
radius
yRadius
Defined in
graphics/js/CanvasDrawing.js:622
Draws a wedge.
x
Number
x-coordinate of the wedge's center point
y
Number
y-coordinate of the wedge's center point
startAngle
Number
starting angle in degrees
arc
Number
sweep of the wedge. Negative values draw clockwise.
radius
Number
radius of wedge. If [optional] yRadius is defined, then radius is the x radius.
yRadius
Number
[optional] y radius for wedge.
getBezierData
Array
Number
Defined in
graphics/js/CanvasDrawing.js:958
Returns the points on a curve
Array
lineTo
point1
point2
Defined in
graphics/js/CanvasDrawing.js:197
Draws a line segment from the current drawing position to the specified x and y coordinates.
moveTo
x
y
Defined in
graphics/js/CanvasDrawing.js:277
Moves the current drawing position to specified x and y coordinates.
quadraticCurveTo
cpx
cpy
x
y
Defined in
graphics/js/CanvasDrawing.js:411
Draws a quadratic bezier curve.
relativeCurveTo
cp1x
cp1y
cp2x
cp2y
x
y
Defined in
graphics/js/CanvasDrawing.js:344
Draws a bezier curve relative to the current coordinates.
relativeLineTo
point1
point2
Defined in
graphics/js/CanvasDrawing.js:211
Draws a line segment from the current drawing position to the relative x and y coordinates.
relativeMoveTo
x
y
Defined in
graphics/js/CanvasDrawing.js:291
Moves the current drawing position relative to specified x and y coordinates.
relativeQuadraticCurveTo
cpx
cpy
x
y
Defined in
graphics/js/CanvasDrawing.js:426
Draws a quadratic bezier curve relative to the current position.
setSize
w
h
Defined in
graphics/js/CanvasDrawing.js:113
Sets the size of the graphics object.
_currentX
Defined in
graphics/js/CanvasDrawing.js:60
Current x position of the drawing.
_currentY
Defined in
graphics/js/CanvasDrawing.js:69
Current y position of the drqwing.
_drawingComplete
Defined in
graphics/js/CanvasDrawing.js:937
Indicates a drawing has completed.