Class: xrx.viewbox.ViewboxTransform

xrx.viewbox. ViewboxTransform

(private) new xrx.viewbox.ViewboxTransform()

A class implementing transformation functions for a drawing view-box.
Source:

Extends

Members

(private) xrx.viewbox.ViewboxTransform#ctm_ :xrx.viewbox.FastAffineTransform

The current transformation matrix of this viewbox.
Type:
Source:

(private) xrx.viewbox.ViewboxTransform#FixPoints_

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#zoomFactor_ :number

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

(private) xrx.viewbox.ViewboxTransform#zoomMax_ :number

The maximum zoom value, defaults to 2.
Type:
  • number
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#zoomMin_ :number

The minimum zoom value, defaults to 0.1.
Type:
  • number
Inherited From:
Source:

Methods

(private) xrx.viewbox.ViewboxTransform#center()

Translates the view-box to the center of the drawing canvas.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#centerHorizontally()

Translates the view-box to the horizontal center of the drawing canvas.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#centerVertically()

Translates the view-box to the vertical center of the drawing canvas.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#containsPoint(point)

Whether a point is contained in this view-box.
Parameters:
Name Type Description
point Array.<number> The native point, without translation.
Inherited From:
Source:

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

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

xrx.viewbox.ViewboxTransform#ctmRestore(dump)

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

(private) xrx.viewbox.ViewboxTransform#direction_() → {number}

Returns a positional utility number representing the current orientation of the view-box.
Inherited From:
Source:
Returns:
The orientation.
Type
number

xrx.viewbox.ViewboxTransform#disposeInternal()

Disposes this view-box.
Source:

xrx.viewbox.ViewboxTransform#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.
Source:

xrx.viewbox.ViewboxTransform#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.
Source:

xrx.viewbox.ViewboxTransform#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.
Source:

(private) xrx.viewbox.ViewboxTransform#getBox() → {goog.math.Box}

Returns the bounding-box for this view-box, respecting transformation.
Inherited From:
Source:
Returns:
The bounding box, coordinates are the visibles and are transformed.
Type
goog.math.Box

(private) xrx.viewbox.ViewboxTransform#getCenterPoint_()

Inherited From:
Source:

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

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

(private) xrx.viewbox.ViewboxTransform#getFixPoint_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#getFixPoints_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#getHeight(opt_transformed, opt_visible) → {number}

Returns the height of this view-box, optionally the transformed height (respecting the current scale) and / or the visible height (respecting the current rotation).
Parameters:
Name Type Description
opt_transformed boolean Whether to return the transformed height respecting the current scale.
opt_visible boolean Whether to return the visible height respecting the current rotation.
Inherited From:
Source:
Returns:
The height.
Type
number

(private) xrx.viewbox.ViewboxTransform#getPivotPoint_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#getPivotPoints_(reverse) → {Array.<number>}

Returns the four pivot points of this view-box.
Parameters:
Name Type Description
reverse boolean If we rotate in right or left direction. If reverse is true we assume left direction otherwise right direction.
Inherited From:
Source:
Returns:
Type
Array.<number>

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

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

(private) xrx.viewbox.ViewboxTransform#getVisibleOrientation_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#getWidth(opt_transformed, opt_visible) → {number}

Returns the width of this view-box, optionally the transformed width (respecting the current scale) and / or the visible width (respecting the current rotation).
Parameters:
Name Type Description
opt_transformed boolean Whether to return the transformed width respecting the current scale.
opt_visible boolean Whether to return the visible width respecting the current rotation.
Inherited From:
Source:
Returns:
The width.
Type
number

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

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

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

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

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

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

xrx.viewbox.ViewboxTransform#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.ViewboxTransform#getZoomValue() → {number}

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

(private) xrx.viewbox.ViewboxTransform#isFixPoint_(fixPoint)

Whether the fix-point is a point, that is an Array of length 2.
Parameters:
Name Type Description
fixPoint ? The fix-point.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#isHorizontal() → {boolean}

Whether the view-box currently is in horizontal orientation.
Inherited From:
Source:
Returns:
Whether the view-box is oriented horizontally.
Type
boolean

(private) xrx.viewbox.ViewboxTransform#isOrientation_(fixPoint)

Whether the fix-point is an orientation, that is one of xrx.drawing.Orientation.*.
Parameters:
Name Type Description
fixPoint ? The fix-point.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#isValidRotation(rotation) → {boolean}

Checks whether the rotation value is valid.
Parameters:
Name Type Description
rotation number The rotation in degrees.
Inherited From:
Source:
Returns:
Whether the rotation is valid.
Type
boolean

(private) xrx.viewbox.ViewboxTransform#isVertical() → {boolean}

Whether the view-box currently is in vertical orientation.
Inherited From:
Source:
Returns:
Whether the view-box is oriented vertically.
Type
boolean

(private) xrx.viewbox.ViewboxTransform#rotateBy(anglenullable, opt_fixPointnullable)

Rotates the view-box by an angle, respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
angle number <nullable>
The angle of rotation in degrees, e.g. 90 or 180.
opt_fixPoint Array.<number> | string <nullable>
A fix-point or an orientation. Defaults to the center of the view-box.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTransform#rotateBy_(anglenullable, opt_orientationnullable, opt_fixPointnullable)

Rotates the view-box by an angle, respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
angle number <nullable>
The angle of rotation in degrees, e.g. 90 or 180.
opt_orientation string <nullable>
An orientation, defaults to xrx.drawing.Orientation.C.
opt_fixPoint Array.<number> <nullable>
A fix-point, defaults to the center of the view-box.
Inherited From:
Source:

xrx.viewbox.ViewboxTransform#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.ViewboxTransform#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.ViewboxTransform#setCTM(ctm)

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

xrx.viewbox.ViewboxTransform#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.ViewboxTransform#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.ViewboxTransform#setZoomFactorMax(value)

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

xrx.viewbox.ViewboxTransform#setZoomFactorMin(value)

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

xrx.viewbox.ViewboxTransform#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.ViewboxTransform#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:

(private) xrx.viewbox.ViewboxTransform#zoomOffset_()

Inherited From:
Source:

xrx.viewbox.ViewboxTransform#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.ViewboxTransform#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: