Class CanvasProps
Defined in: canvasprops.js.
Constructor Attributes | Constructor Name and Description |
---|---|
CanvasProps(width, height)
A wrapper for canvas element.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
CanvasProps.DEFAULT_HEIGHT
default height for canvas
|
<static> |
CanvasProps.DEFAULT_WIDTH
default width for canvas
|
Canvas height
|
|
Canvas id.
|
|
Serialization type
|
|
Canvas width
|
Method Attributes | Method Name and Description |
---|---|
Return the height of the canvas
|
|
getWidth()
Get width of the canvas
|
|
<static> |
CanvasProps.load(o)
We only ever have one instance of this class (like stack)
but we need the creation of the Canvas to appear AFTER the page exists,
otherwise we would not be able to add it dinamically to the document.
|
setHeight(height)
Set the height of the canvas.
|
|
setWidth(width)
Set the width of the canvas.
|
|
sync()
Resize the Canvas to current values
|
|
toString()
Returns a representation of the object
|
Class Detail
CanvasProps(width, height)
A wrapper for canvas element. This should only used to save / store canvas' properties
Author: Zack Newsham, Alex Gheorghiu .
Author: Zack Newsham
- Parameters:
- {Number} width
- - the width of the {Canvas}
- {Number} height
- - the height of the {Canvas}
Field Detail
<static>
CanvasProps.DEFAULT_HEIGHT
default height for canvas
<static>
CanvasProps.DEFAULT_WIDTH
default width for canvas
height
Canvas height
id
Canvas id. Used in main.js:updateFigure() to see what object we have
oType
Serialization type
width
Canvas width
Method Detail
getHeight()
Return the height of the canvas
getWidth()
Get width of the canvas
<static>
CanvasProps.load(o)
We only ever have one instance of this class (like stack)
but we need the creation of the Canvas to appear AFTER the page exists,
otherwise we would not be able to add it dinamically to the document.
Author: Zack Newsham, Alex Gheorghiu .
Author: Zack Newsham
- Parameters:
- {JSONObject} o
- Returns:
- new {Canvas}
setHeight(height)
Set the height of the canvas. Also force a Canvas resize
- Parameters:
- {Numeric} height
- - the new height
setWidth(width)
Set the width of the canvas. Also force a canvas resize
- Parameters:
- {Numeric} width
- - the new width
sync()
Resize the Canvas to current values
Author: alex@scriptoid.com.
Author: alex@scriptoid.com.
{String}
toString()
Returns a representation of the object
- Returns:
- {String}