Class: xrx.viewbox.Viewbox

xrx.viewbox. Viewbox

new xrx.viewbox.Viewbox(drawing)

A class representing the view-box of a drawing canvas.
Parameters:
Name Type Description
drawing xrx.drawing.Drawing The parent drawing object.
Source:

Extends

Methods

xrx.viewbox.Viewbox#ctmDump() → {Array.<number>}

Returns a dump of the current transformation matrix as an array.
Inherited From:
Source:
Returns:
The number array.
Type
Array.<number>

xrx.viewbox.Viewbox#ctmRestore(dump)

Restores the current transformation matrix from an array.
Parameters:
Name Type Description
dump Array.<number> The number array.
Inherited From:
Source:

xrx.viewbox.Viewbox#disposeInternal()

Disposes this view-box.
Source:

xrx.viewbox.Viewbox#fit(opt_center)

Makes the whole view-box visible and optionally centers it.
Parameters:
Name Type Description
opt_center boolean Whether to also center the canvas, defaults to true.
Inherited From:
Source:

xrx.viewbox.Viewbox#fitToHeight(opt_center)

Makes the whole height of the view-box visible and optionally centers it.
Parameters:
Name Type Description
opt_center boolean Whether to also center the canvas, defaults to true.
Inherited From:
Source:

xrx.viewbox.Viewbox#fitToWidth(opt_center)

Makes the whole width of the view-box visible and optionally centers it.
Parameters:
Name Type Description
opt_center boolean Whether to also center the canvas, defaults to true.
Inherited From:
Source:

xrx.viewbox.Viewbox#getCTM() → {xrx.viewbox.FastAffineTransform}

Returns the current transformation matrix of this view-box.
Inherited From:
Source:
Returns:
The transformation matrix.
Type
xrx.viewbox.FastAffineTransform

xrx.viewbox.Viewbox#getRotation() → {number}

Returns the current rotation in degrees.
Inherited From:
Source:
Returns:
The current rotation in degrees.
Type
number

xrx.viewbox.Viewbox#getZoomFactor() → {number}

Returns the current zoom factor, defaults to .1.
Inherited From:
Source:
Returns:
The zoom factor.
Type
number

xrx.viewbox.Viewbox#getZoomMax() → {number}

Returns the current maximum zoom value.
Inherited From:
Source:
Returns:
The maximum zoom value.
Type
number

xrx.viewbox.Viewbox#getZoomMin() → {number}

Returns the current minimum zoom value.
Inherited From:
Source:
Returns:
The minimum zoom value.
Type
number

xrx.viewbox.Viewbox#getZoomStep(opt_zoomValuenullable) → {number}

Returns the current zoom step or the zoom step of a zoom value if opt_zoomValue is defined.
Parameters:
Name Type Attributes Description
opt_zoomValue number <nullable>
A zoom value.
Inherited From:
Source:
Returns:
The zoom step.
Type
number

xrx.viewbox.Viewbox#getZoomValue() → {number}

Returns the current zoom value.
Inherited From:
Source:
Returns:
Type
number

xrx.viewbox.Viewbox#rotateLeft(opt_fixPointnullable)

Rotates the view-box by 90° in left direction, optionally respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
opt_fixPoint Array.<number> | string <nullable>
The fix-point.
Inherited From:
Source:

xrx.viewbox.Viewbox#rotateRight(opt_fixPointnullable)

Rotates the view-box by 90° in right direction, optionally respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
opt_fixPoint Array.<number> | string <nullable>
The fix-point.
Inherited From:
Source:

xrx.viewbox.Viewbox#setCTM(ctm)

Sets the current transformation matrix of the view-box.
Parameters:
Name Type Description
ctm xrx.viewbox.FastAffineTransform The matrix object.
Inherited From:
Source:

xrx.viewbox.Viewbox#setPosition(position)

Translates the view-box to a certain position of the drawing canvas.
Parameters:
Name Type Description
position string A position as declared in {xrx.drawing.Position}.
Inherited From:
Source:

xrx.viewbox.Viewbox#setZoomFactor(factor)

Sets a new zoom factor, e.g. 0.1.
Parameters:
Name Type Description
factor number The new zoom factor.
Inherited From:
Source:

xrx.viewbox.Viewbox#setZoomFactorMax(value)

Sets the maximum zoom value.
Parameters:
Name Type Description
value number The maximum zoom value.
Inherited From:
Source:

xrx.viewbox.Viewbox#setZoomFactorMin(value)

Sets the minimum zoom value.
Parameters:
Name Type Description
value number The minimum zoom value.
Inherited From:
Source:

xrx.viewbox.Viewbox#translate(x, y)

Translates the view-box.
Parameters:
Name Type Description
x number The distance to translate in the x direction.
y number The distance to translate in the y direction.
Inherited From:
Source:

xrx.viewbox.Viewbox#zoomIn(opt_fixPoint)

Zoom in on the view-box, optionally respecting a fix-point.
Parameters:
Name Type Description
opt_fixPoint Array.<number> A fix-point.
Inherited From:
Source:

xrx.viewbox.Viewbox#zoomOut(opt_fixPoint)

Zoom out the view-box, optionally respecting a fix-point.
Parameters:
Name Type Description
opt_fixPoint Array.<number> A fix-point.
Inherited From:
Source:

xrx.viewbox.Viewbox#zoomTo(zoomValue, opt_fixPointnullable)

Zooms the view-box to a value, optionally respecting a fix-point.
Parameters:
Name Type Attributes Description
zoomValue number The zoom value.
opt_fixPoint number <nullable>
A fix-point.
Inherited From:
Source: