new CRect()
common/geometry/Rect.js, line 10
Example
var a = new CRect();//預設建構子
var b = new CRect(a);//複製指定CRect
var c = new CRect(0, 0, 0, 0);//指定left,top,right,bottom並建立CRect
var d = new CRect({left:0,top:0,right:0,bottom:0});//使用帶有left,top,right,bottom的Object建立CRect
Members
-
bottomnumber
-
下面
- Default Value:
- 0
-
readonlyHeight
-
高度
Properties:
Name Type Description Height
number 高度
-
leftnumber
-
左邊
- Default Value:
- 0
-
rightnumber
-
右邊
- Default Value:
- 0
-
topnumber
-
上面
- Default Value:
- 0
-
readonlyWidth
-
寬度
Properties:
Name Type Description Width
number 寬度
Methods
-
CopyFrom(obj, top, right, bottom){CRect}
common/geometry/Rect.js, line 86 -
複製。
Name Type Description obj
CRect | number 為top,或本身就是一個CRect。
top
number optional 若Obj參數為left使用,否則此參數無意義。
right
number optional 若Obj參數為left使用,否則此參數無意義。
bottom
number optional 若Obj參數為left使用,否則此參數無意義。
Returns:
Type Description CRect 傳回this。 -
IsEqual(rect){boolean}
common/geometry/Rect.js, line 106 -
是否相等。
Name Type Description rect
CRect 比較的Rect。
Returns:
Type Description boolean 傳回比較的結果。 -
IsNotEqual(rect){boolean}
common/geometry/Rect.js, line 114 -
是否不相等。
Name Type Description rect
CRect 比較的Rect。
Returns:
Type Description boolean 傳回比較的結果。 -
PtInRect(p){boolean}
common/geometry/Rect.js, line 131 -
檢查p是否位於Rect範圍內。
Name Type Description p
GeoPoint 檢查的值。
Returns:
Type Description boolean 傳回檢查的結果。 -
SetNULL()
common/geometry/Rect.js, line 120 -
將left,top,right,bottom都設為0