blob: e029a29e6234d14bf42408f8041274c47d1994e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/**
* $Id: mxPoint.js,v 1.12 2010-01-02 09:45:14 gaudenz Exp $
* Copyright (c) 2006-2010, JGraph Ltd
*/
/**
* Class: mxPoint
*
* Implements a 2-dimensional vector with double precision coordinates.
*
* Constructor: mxPoint
*
* Constructs a new point for the optional x and y coordinates. If no
* coordinates are given, then the default values for <x> and <y> are used.
*/
function mxPoint(x, y)
{
this.x = (x != null) ? x : 0;
this.y = (y != null) ? y : 0;
};
/**
* Variable: x
*
* Holds the x-coordinate of the point. Default is 0.
*/
mxPoint.prototype.x = null;
/**
* Variable: y
*
* Holds the y-coordinate of the point. Default is 0.
*/
mxPoint.prototype.y = null;
/**
* Function: equals
*
* Returns true if the given object equals this rectangle.
*/
mxPoint.prototype.equals = function(obj)
{
return obj.x == this.x &&
obj.y == this.y;
};
/**
* Function: clone
*
* Returns a clone of this <mxPoint>.
*/
mxPoint.prototype.clone = function()
{
// Handles subclasses as well
return mxUtils.clone(this);
};
|