Class: AspectRatio

graphics.geom. AspectRatio


new AspectRatio( [width] [, height] [, lock] [, verbose])

The AspectRatio object encapsulates the width and height components of an object.

The AspectRatio object encapsulates the width and height components of an object.

Parameters:
Name Type Argument Default Description
width number <optional>
0

The width value.

height number <optional>
0

The height value.

lock boolean <optional>
false

This flag indicates if the aspect ratio must be keeped when the width or height values changes.

verbose boolean <optional>
false

This flag indicates if the toString method is verbose or not.

Extends

Members


gcd :Number

Determinates the greatest common divisor if the current object.

This property cast the width and the height Number in two int objects to calculate the value.

Type:
  • Number

height :Number

The height value, in pixels.

Type:
  • Number
Overrides:
Default Value:
  • 0

verbose :Boolean

The verbose mode of the class used in the toString() method.

Type:
  • Boolean
Default Value:
  • false

width :Number

The width value, in pixels.

Type:
  • Number
Overrides:
Default Value:
  • 0

Methods


clone()

Returns a shallow copy of the object.

Overrides:
Returns:

a shallow copy of the object.


copyFrom()

Copies all of data from the source AspectRatio object into the calling AspectRatio object.

Overrides:

decrease( [dWidth] [, dHeight])

Decreases the size by a specific width/height values and return its self(this).

Parameters:
Name Type Argument Default Description
dWidth number <optional>
0

A number value to descrease the width component of the object (default 0).

dHeight number <optional>
0

A number value to descrease the height component of the object (default 0).

Inherited From:

equals()

Compares the passed-in object with this object for equality.

Inherited From:
Returns:

true if the the specified object is equal with this object.


increase( [dWidth] [, dHeight])

Increases the size by a specific width/height values and return its self(this).

Parameters:
Name Type Argument Default Description
dWidth number <optional>
0

A number value to increase the width component of the object (default 0).

dHeight number <optional>
0

A number value to inscrease the height component of the object (default 0).

Inherited From:
Returns:

the current reference of this object.


isEmpty()

Determines whether or not this Rectangle object is empty.

Inherited From:
Returns:

A value of true if the Rectangle object's width or height is less than or equal to 0; otherwise false.

Type
boolean

isLocked()

Returns true if the object is locked.

Returns:

true if the object is locked.


lock()

Locks the object.


setTo(width, height)

Sets the members of Dimension to the specified values.

Parameters:
Name Type Description
width number

The width component value to change (default 0).

height number

The height component value to change (default 0).

Inherited From:
Returns:

The object reference.

Type
graphics.geom.Dimension

toObject()

Returns the Object representation of this object.

Inherited From:
Returns:

the Object representation of this object.


toString()

Returns the string representation of this object.

Overrides:
Returns:

the string representation of this object.


unlock()

Unlocks the object.