For up to date documentation and features, visit http://docs.sencha.com/ext-js/4-0

## Sencha Documentation

# Ext.util.Point

####

    HierarchyExt.util.RegionExt.util.Point

Represents a 2D point with x and y properties, useful for comparison and instantiation from an event:

    var point = Ext.util.Point.fromEvent(e);

Defined By

### Properties

Ext.util.Point
view source
translate : Object

Translate this region by the given offset amount. TODO: Either use translate or translateBy!

Translate this region by the given offset amount. TODO: Either use translate or translateBy!

Defined By

### Methods

Ext.util.Region
view source
Point( Number top, Number right, Number bottom, Number left) : void

### Parameters

- top : Number

  Top

- right : Number

  Right

- bottom : Number

  Bottom

- left : Number

  Left

### Returns

- void

Ext.util.Region
view source
adjust( Number top, Number right, Number bottom, Number left) : void

Modifies the current region to be adjusted by offsets.

Modifies the current region to be adjusted by offsets.

### Parameters

- top : Number

  top offset

- right : Number

  right offset

- bottom : Number

  bottom offset

- left : Number

  left offset

### Returns

- void

Ext.util.Region
view source
constrainTo( Ext.util.Region targetRegion) : void

Modifies the current region to be constrained to the targetRegion.

Modifies the current region to be constrained to the targetRegion.

### Parameters

- targetRegion : Ext.util.Region

### Returns

- void

Ext.util.Region
view source
contains( Ext.util.Region region) : void

Checks if this region completely contains the region that is passed in.

Checks if this region completely contains the region that is passed in.

### Parameters

- region : Ext.util.Region

### Returns

- void

Ext.util.Region
view source
copy : Ext.util.Region

Copy a new instance

Copy a new instance

### Returns

- Ext.util.Region

Ext.util.Region
view source
copyFrom( Region The) : Ext.util.Point

Copy the values of another Region to this Region

Copy the values of another Region to this Region

### Parameters

- The : Region

  region to copy from.

### Returns

- Ext.util.Point

  this This point

Ext.util.Point
view source
equals( Ext.util.Point/Object The) : Boolean

Compare this point and another point

Compare this point and another point

### Parameters

- The : Ext.util.Point/Object

  point to compare with, either an instance of Ext.util.Point or an object with left and top properties

### Returns

- Boolean

  Returns whether they are equivalent

Ext.util.Region
view source
from( Object o) : Ext.util.Region

### Parameters

- o : Object

  An object with top, right, bottom, left properties

### Returns

- Ext.util.Region

  region The region constructed based on the passed object

Ext.util.Point
view source
fromEvent( Event e) : void

Returns a new instance of Ext.util.Point base on the pageX / pageY values of the given event

Returns a new instance of Ext.util.Point base on the pageX / pageY values of the given event

### Parameters

- e : Event

  The event

### Returns

- void

  Ext.util.Point

Ext.util.Region
view source
getOutOfBoundOffset( String axis, Ext.util.Point p) : Ext.util.Offset

Get the offset amount of a point outside the region

Get the offset amount of a point outside the region

### Parameters

- axis : String

  optional

- p : Ext.util.Point

  the point

### Returns

- Ext.util.Offset

Ext.util.Region
view source
getOutOfBoundOffsetX( Number p) : Number

Get the offset amount on the x-axis

Get the offset amount on the x-axis

### Parameters

- p : Number

  the offset

### Returns

- Number

Ext.util.Region
view source
getOutOfBoundOffsetY( Number p) : Number

Get the offset amount on the y-axis

Get the offset amount on the y-axis

### Parameters

- p : Number

  the offset

### Returns

- Number

Ext.util.Region
view source
getRegion( Mixed el) : Ext.util.Region

### Parameters

- el : Mixed

  A string, DomElement or Ext.core.Element representing an element on the page.

### Returns

- Ext.util.Region

  region Retrieves an Ext.util.Region for a particular element.

Ext.util.Region
view source
intersect( Ext.util.Region region) : Ext.util.Region/Boolean

Checks if this region intersects the region passed in.

Checks if this region intersects the region passed in.

### Parameters

- region : Ext.util.Region

### Returns

- Ext.util.Region/Boolean

  Returns the intersected region or false if there is no intersection.

Ext.util.Region
view source
isOutOfBound( String axis, Ext.util.Point/Number p) : Boolean

Check whether the point / offset is out of bound

Check whether the point / offset is out of bound

### Parameters

- axis : String

  optional

- p : Ext.util.Point/Number

  the point / offset

### Returns

- Boolean

Ext.util.Region
view source
isOutOfBoundX( Number p) : Boolean

Check whether the offset is out of bound in the x-axis

Check whether the offset is out of bound in the x-axis

### Parameters

- p : Number

  the offset

### Returns

- Boolean

Ext.util.Region
view source
isOutOfBoundY( Number p) : Boolean

Check whether the offset is out of bound in the y-axis

Check whether the offset is out of bound in the y-axis

### Parameters

- p : Number

  the offset

### Returns

- Boolean

Ext.util.Point
view source
isWithin( Ext.util.Point/Object The, Object/Number threshold) : Boolean

Whether the given point is not away from this point within the given threshold amount. TODO: Rename this isNear.

Whether the given point is not away from this point within the given threshold amount. TODO: Rename this isNear.

### Parameters

- The : Ext.util.Point/Object

  point to check with, either an instance of Ext.util.Point or an object with left and top properties

- threshold : Object/Number

  Can be either an object with x and y properties or a number

### Returns

- Boolean

Ext.util.Region
view source
round : Ext.util.Region

Round all the properties of this region

Round all the properties of this region

### Returns

- Ext.util.Region

  this This Region

Ext.util.Point
view source
roundedEquals( Ext.util.Point/Object The) : Boolean
Compare this point with another point when the x and y values of both points are rounded. E.g: [100.3,199.8] will equ...

Compare this point with another point when the x and y values of both points are rounded. E.g: [100.3,199.8] will equals to [100, 200]

### Parameters

- The : Ext.util.Point/Object

  point to compare with, either an instance of Ext.util.Point or an object with x and y properties

### Returns

- Boolean

Ext.util.Point
view source
toString : String

Returns a human-eye-friendly string that represents this point, useful for debugging

Returns a human-eye-friendly string that represents this point, useful for debugging

### Returns

- String

Ext.util.Region
view source
translateBy( Ext.util.Offset/Object offset, Number The) : Ext.util.Region

Translate this region by the given offset amount

Translate this region by the given offset amount

### Parameters

- offset : Ext.util.Offset/Object

  Object containing the `x` and `y` properties. Or the x value is using the two argument form.

- The : Number

  y value unless using an Offset object.

### Returns

- Ext.util.Region

  this This Region

Ext.util.Region
view source
union( Ext.util.Region region) : void

Returns the smallest region that contains the current AND targetRegion.

Returns the smallest region that contains the current AND targetRegion.

### Parameters

- region : Ext.util.Region

### Returns

- void