mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Use Point#read in Point#min and Point#max.
This commit is contained in:
parent
29863b852a
commit
74dd89a68b
1 changed files with 4 additions and 0 deletions
|
@ -492,6 +492,8 @@ var Point = this.Point = Base.extend({
|
|||
* @return The newly created point object
|
||||
*/
|
||||
min: function(point1, point2) {
|
||||
point1 = Point.read(arguments, 0, 1);
|
||||
point2 = Point.read(arguments, 1, 1);
|
||||
return Point.create(
|
||||
Math.min(point1.x, point2.x),
|
||||
Math.min(point1.y, point2.y)
|
||||
|
@ -515,6 +517,8 @@ var Point = this.Point = Base.extend({
|
|||
* @return The newly created point object
|
||||
*/
|
||||
max: function(point1, point2) {
|
||||
point1 = Point.read(arguments, 0, 1);
|
||||
point2 = Point.read(arguments, 1, 1);
|
||||
return Point.create(
|
||||
Math.max(point1.x, point2.x),
|
||||
Math.max(point1.y, point2.y)
|
||||
|
|
Loading…
Reference in a new issue