mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-09 06:12:34 -05:00
1232 lines
No EOL
30 KiB
HTML
1232 lines
No EOL
30 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Rectangle</title>
|
|
<base target="classFrame">
|
|
<link rel="stylesheet" href="../resources/css/reference.css" type="text/css">
|
|
<link rel="stylesheet" href="../resources/css/style.css" type="text/css">
|
|
<link rel="stylesheet" href="../resources/css/paperscript.css" type="text/css">
|
|
<link rel="stylesheet" href="../resources/css/codemirror.css" type="text/css">
|
|
<script src="../resources/js/bootstrap.js" type="text/javascript"></script>
|
|
<script src="../resources/js/paper.js" type="text/javascript"></script>
|
|
<script src="../resources/js/codemirror.js" type="text/javascript"></script>
|
|
<script src="../resources/js/reference.js" type="text/javascript"></script>
|
|
</head>
|
|
<body class="reference">
|
|
<div class="reference-class">
|
|
<h1>Rectangle</h1>
|
|
|
|
<p>A Rectangle specifies an area that is enclosed by it's top-left
|
|
point (x, y), its width, and its height. It should not be confused with a
|
|
rectangular path, it is not an item.</p>
|
|
</div>
|
|
|
|
<!-- ============================== constructors ========================= -->
|
|
<div class="reference-members"><h2>Constructors</h2>
|
|
|
|
|
|
<div id="rectangle-point-size-member" class="member">
|
|
<div id="rectangle-point-size-link" class="member-link">
|
|
<a name="rectangle-point-size" href="#" onClick="return toggleMember('rectangle-point-size', false);"><tt><b>Rectangle</b>(point, size)</tt></a>
|
|
</div>
|
|
<div id="rectangle-point-size-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('rectangle-point-size', false);"><tt><b>Rectangle</b>(point, size)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('rectangle-point-size', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Creates a Rectangle object.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>point:</tt>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
— the top-left point of the rectangle
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<tt>size:</tt>
|
|
<a href="../classes/Size.html"><tt>Size</tt></a>
|
|
— the size of the rectangle
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="rectangle-x-y-width-height-member" class="member">
|
|
<div id="rectangle-x-y-width-height-link" class="member-link">
|
|
<a name="rectangle-x-y-width-height" href="#" onClick="return toggleMember('rectangle-x-y-width-height', false);"><tt><b>Rectangle</b>(x, y, width, height)</tt></a>
|
|
</div>
|
|
<div id="rectangle-x-y-width-height-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('rectangle-x-y-width-height', false);"><tt><b>Rectangle</b>(x, y, width, height)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('rectangle-x-y-width-height', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Creates a rectangle object.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>x:</tt>
|
|
Number
|
|
— the left coordinate
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<tt>y:</tt>
|
|
Number
|
|
— the top coordinate
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<tt>width:</tt>
|
|
Number
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<tt>height:</tt>
|
|
Number
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="rectangle-point1-point2-member" class="member">
|
|
<div id="rectangle-point1-point2-link" class="member-link">
|
|
<a name="rectangle-point1-point2" href="#" onClick="return toggleMember('rectangle-point1-point2', false);"><tt><b>Rectangle</b>(point1, point2)</tt></a>
|
|
</div>
|
|
<div id="rectangle-point1-point2-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('rectangle-point1-point2', false);"><tt><b>Rectangle</b>(point1, point2)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('rectangle-point1-point2', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Creates a rectangle object from the passed points. These do not
|
|
necessarily need to be the top left and bottom right corners, the
|
|
constructor figures out how to fit a rectangle between them.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>point1:</tt>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
— The first point defining the rectangle
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<tt>point2:</tt>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
— The second point defining the rectangle
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="rectangle-rt-member" class="member">
|
|
<div id="rectangle-rt-link" class="member-link">
|
|
<a name="rectangle-rt" href="#" onClick="return toggleMember('rectangle-rt', false);"><tt><b>Rectangle</b>(rt)</tt></a>
|
|
</div>
|
|
<div id="rectangle-rt-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('rectangle-rt', false);"><tt><b>Rectangle</b>(rt)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('rectangle-rt', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Creates a new rectangle object from the passed rectangle object.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>rt:</tt>
|
|
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- ============================== properties ========================= -->
|
|
<div class="reference-members"><h2>Operators</h2>
|
|
|
|
<div id="equals-member" class="member">
|
|
<div id="equals-link" class="member-link">
|
|
<a name="equals" href="#" onClick="return toggleMember('equals', false);"><tt><tt><b>==</b> Rectangle</tt></tt></a>
|
|
</div>
|
|
<div id="equals-description" class="member-description hidden">
|
|
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('equals', false);"><tt><b>==</b> Rectangle</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('equals', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>Checks whether the coordinates and size of the rectangle are equal to
|
|
that of the supplied rectangle.</p>
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt>Boolean</tt> — <tt>true</tt> if the rectangles are equal, <tt>false</tt> otherwise
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="reference-members"><h2>Properties</h2>
|
|
|
|
|
|
<div id="x-member" class="member">
|
|
<div id="x-link" class="member-link">
|
|
<a name="x" href="#" onClick="return toggleMember('x', false);"><tt><b>x</b></tt></a>
|
|
</div>
|
|
<div id="x-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('x', false);"><tt><b>x</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('x', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The x position of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="y-member" class="member">
|
|
<div id="y-link" class="member-link">
|
|
<a name="y" href="#" onClick="return toggleMember('y', false);"><tt><b>y</b></tt></a>
|
|
</div>
|
|
<div id="y-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('y', false);"><tt><b>y</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('y', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The y position of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="width-member" class="member">
|
|
<div id="width-link" class="member-link">
|
|
<a name="width" href="#" onClick="return toggleMember('width', false);"><tt><b>width</b></tt></a>
|
|
</div>
|
|
<div id="width-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('width', false);"><tt><b>width</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('width', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The width of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="height-member" class="member">
|
|
<div id="height-link" class="member-link">
|
|
<a name="height" href="#" onClick="return toggleMember('height', false);"><tt><b>height</b></tt></a>
|
|
</div>
|
|
<div id="height-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('height', false);"><tt><b>height</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('height', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The height of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="point-member" class="member">
|
|
<div id="point-link" class="member-link">
|
|
<a name="point" href="#" onClick="return toggleMember('point', false);"><tt><b>point</b></tt></a>
|
|
</div>
|
|
<div id="point-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('point', false);"><tt><b>point</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('point', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The top-left point of the rectangle</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="size-member" class="member">
|
|
<div id="size-link" class="member-link">
|
|
<a name="size" href="#" onClick="return toggleMember('size', false);"><tt><b>size</b></tt></a>
|
|
</div>
|
|
<div id="size-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('size', false);"><tt><b>size</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('size', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The size of the rectangle</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Size.html"><tt>Size</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>Side Positions</h3>
|
|
|
|
<div id="left-member" class="member">
|
|
<div id="left-link" class="member-link">
|
|
<a name="left" href="#" onClick="return toggleMember('left', false);"><tt><b>left</b></tt></a>
|
|
</div>
|
|
<div id="left-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('left', false);"><tt><b>left</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('left', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The position of the left hand side of the rectangle. Note that this
|
|
doesn't move the whole rectangle; the right hand side stays where it was.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="top-member" class="member">
|
|
<div id="top-link" class="member-link">
|
|
<a name="top" href="#" onClick="return toggleMember('top', false);"><tt><b>top</b></tt></a>
|
|
</div>
|
|
<div id="top-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('top', false);"><tt><b>top</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('top', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The top coordinate of the rectangle. Note that this doesn't move the
|
|
whole rectangle: the bottom won't move.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="right-member" class="member">
|
|
<div id="right-link" class="member-link">
|
|
<a name="right" href="#" onClick="return toggleMember('right', false);"><tt><b>right</b></tt></a>
|
|
</div>
|
|
<div id="right-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('right', false);"><tt><b>right</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('right', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The position of the right hand side of the rectangle. Note that this
|
|
doesn't move the whole rectangle; the left hand side stays where it was.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="bottom-member" class="member">
|
|
<div id="bottom-link" class="member-link">
|
|
<a name="bottom" href="#" onClick="return toggleMember('bottom', false);"><tt><b>bottom</b></tt></a>
|
|
</div>
|
|
<div id="bottom-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('bottom', false);"><tt><b>bottom</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('bottom', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The bottom coordinate of the rectangle. Note that this doesn't move the
|
|
whole rectangle: the top won't move.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
Number
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>Corner and Center Point Positions</h3>
|
|
|
|
<div id="center-member" class="member">
|
|
<div id="center-link" class="member-link">
|
|
<a name="center" href="#" onClick="return toggleMember('center', false);"><tt><b>center</b></tt></a>
|
|
</div>
|
|
<div id="center-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('center', false);"><tt><b>center</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('center', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The center point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="topleft-member" class="member">
|
|
<div id="topleft-link" class="member-link">
|
|
<a name="topleft" href="#" onClick="return toggleMember('topleft', false);"><tt><b>topLeft</b></tt></a>
|
|
</div>
|
|
<div id="topleft-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('topleft', false);"><tt><b>topLeft</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('topleft', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The top-left point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="topright-member" class="member">
|
|
<div id="topright-link" class="member-link">
|
|
<a name="topright" href="#" onClick="return toggleMember('topright', false);"><tt><b>topRight</b></tt></a>
|
|
</div>
|
|
<div id="topright-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('topright', false);"><tt><b>topRight</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('topright', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The top-right point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="bottomleft-member" class="member">
|
|
<div id="bottomleft-link" class="member-link">
|
|
<a name="bottomleft" href="#" onClick="return toggleMember('bottomleft', false);"><tt><b>bottomLeft</b></tt></a>
|
|
</div>
|
|
<div id="bottomleft-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('bottomleft', false);"><tt><b>bottomLeft</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('bottomleft', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The bottom-left point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="bottomright-member" class="member">
|
|
<div id="bottomright-link" class="member-link">
|
|
<a name="bottomright" href="#" onClick="return toggleMember('bottomright', false);"><tt><b>bottomRight</b></tt></a>
|
|
</div>
|
|
<div id="bottomright-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('bottomright', false);"><tt><b>bottomRight</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('bottomright', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The bottom-right point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="leftcenter-member" class="member">
|
|
<div id="leftcenter-link" class="member-link">
|
|
<a name="leftcenter" href="#" onClick="return toggleMember('leftcenter', false);"><tt><b>leftCenter</b></tt></a>
|
|
</div>
|
|
<div id="leftcenter-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('leftcenter', false);"><tt><b>leftCenter</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('leftcenter', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The left-center point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="topcenter-member" class="member">
|
|
<div id="topcenter-link" class="member-link">
|
|
<a name="topcenter" href="#" onClick="return toggleMember('topcenter', false);"><tt><b>topCenter</b></tt></a>
|
|
</div>
|
|
<div id="topcenter-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('topcenter', false);"><tt><b>topCenter</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('topcenter', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The top-center point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="rightcenter-member" class="member">
|
|
<div id="rightcenter-link" class="member-link">
|
|
<a name="rightcenter" href="#" onClick="return toggleMember('rightcenter', false);"><tt><b>rightCenter</b></tt></a>
|
|
</div>
|
|
<div id="rightcenter-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('rightcenter', false);"><tt><b>rightCenter</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('rightcenter', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The right-center point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="bottomcenter-member" class="member">
|
|
<div id="bottomcenter-link" class="member-link">
|
|
<a name="bottomcenter" href="#" onClick="return toggleMember('bottomcenter', false);"><tt><b>bottomCenter</b></tt></a>
|
|
</div>
|
|
<div id="bottomcenter-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('bottomcenter', false);"><tt><b>bottomCenter</b></tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('bottomcenter', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div class="member-text">
|
|
<p>The bottom-center point of the rectangle.</p>
|
|
|
|
|
|
<ul><b>Type:</b>
|
|
<li>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- ============================== methods ================================ -->
|
|
<div class="reference-members"><h2>Functions</h2>
|
|
|
|
|
|
<div id="isempty-member" class="member">
|
|
<div id="isempty-link" class="member-link">
|
|
<a name="isempty" href="#" onClick="return toggleMember('isempty', false);"><tt><b>isEmpty</b>()</tt></a>
|
|
</div>
|
|
<div id="isempty-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('isempty', false);"><tt><b>isEmpty</b>()</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('isempty', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
|
|
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt>Boolean</tt> — <tt>true</tt> the rectangle is empty, <tt>false</tt> otherwise
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="tostring-member" class="member">
|
|
<div id="tostring-link" class="member-link">
|
|
<a name="tostring" href="#" onClick="return toggleMember('tostring', false);"><tt><b>toString</b>()</tt></a>
|
|
</div>
|
|
<div id="tostring-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('tostring', false);"><tt><b>toString</b>()</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('tostring', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
|
|
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt>String</tt> — A string representation of this rectangle.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>Geometric Tests</h3>
|
|
|
|
<div id="contains-point-member" class="member">
|
|
<div id="contains-point-link" class="member-link">
|
|
<a name="contains-point" href="#" onClick="return toggleMember('contains-point', false);"><tt><b>contains</b>(point)</tt></a>
|
|
</div>
|
|
<div id="contains-point-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('contains-point', false);"><tt><b>contains</b>(point)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('contains-point', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Tests if the specified point is inside the boundary of the rectangle.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>point:</tt>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
— the specified point
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt>Boolean</tt> — <tt>true</tt> if the point is inside the rectangle's boundary, <tt>false</tt> otherwise
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="contains-rect-member" class="member">
|
|
<div id="contains-rect-link" class="member-link">
|
|
<a name="contains-rect" href="#" onClick="return toggleMember('contains-rect', false);"><tt><b>contains</b>(rect)</tt></a>
|
|
</div>
|
|
<div id="contains-rect-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('contains-rect', false);"><tt><b>contains</b>(rect)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('contains-rect', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Tests if the interior of the rectangle entirely contains the specified
|
|
rectangle.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>rect:</tt>
|
|
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
|
— The specified rectangle
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt>Boolean</tt> — <tt>true</tt> if the rectangle entirely contains the specified
|
|
rectangle, <tt>false</tt> otherwise
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="intersects-rect-member" class="member">
|
|
<div id="intersects-rect-link" class="member-link">
|
|
<a name="intersects-rect" href="#" onClick="return toggleMember('intersects-rect', false);"><tt><b>intersects</b>(rect)</tt></a>
|
|
</div>
|
|
<div id="intersects-rect-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('intersects-rect', false);"><tt><b>intersects</b>(rect)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('intersects-rect', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Tests if the interior of this rectangle intersects the interior of
|
|
another rectangle.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>rect:</tt>
|
|
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
|
— the specified rectangle
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt>Boolean</tt> — <tt>true</tt> if the rectangle and the specified rectangle
|
|
intersect each other, <tt>false</tt> otherwise
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>Boolean Operations</h3>
|
|
|
|
<div id="intersect-rect-member" class="member">
|
|
<div id="intersect-rect-link" class="member-link">
|
|
<a name="intersect-rect" href="#" onClick="return toggleMember('intersect-rect', false);"><tt><b>intersect</b>(rect)</tt></a>
|
|
</div>
|
|
<div id="intersect-rect-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('intersect-rect', false);"><tt><b>intersect</b>(rect)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('intersect-rect', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Returns a new rectangle representing the intersection of this rectangle
|
|
with the specified rectangle.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>rect:</tt>
|
|
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
|
— The rectangle to be intersected with this
|
|
rectangle
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — The largest rectangle contained in both the specified
|
|
rectangle and in this rectangle.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="unite-rect-member" class="member">
|
|
<div id="unite-rect-link" class="member-link">
|
|
<a name="unite-rect" href="#" onClick="return toggleMember('unite-rect', false);"><tt><b>unite</b>(rect)</tt></a>
|
|
</div>
|
|
<div id="unite-rect-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('unite-rect', false);"><tt><b>unite</b>(rect)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('unite-rect', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Returns a new rectangle representing the union of this rectangle with the
|
|
specified rectangle.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>rect:</tt>
|
|
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
|
— the rectangle to be combined with this rectangle
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
<ul><b>Returns:</b>
|
|
|
|
<li>
|
|
<tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the smallest rectangle containing both the specified
|
|
rectangle and this rectangle.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="include-point-member" class="member">
|
|
<div id="include-point-link" class="member-link">
|
|
<a name="include-point" href="#" onClick="return toggleMember('include-point', false);"><tt><b>include</b>(point)</tt></a>
|
|
</div>
|
|
<div id="include-point-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('include-point', false);"><tt><b>include</b>(point)</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('include-point', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">
|
|
<p>Adds a point to this rectangle. The resulting rectangle is the
|
|
smallest rectangle that contains both the original rectangle and the
|
|
specified point.</p>
|
|
<p>After adding a point, a call to <a href="../classes/Rectangle.html#contains-point" onclick="return toggleMember('contains-point', true);"><tt>contains(point)</tt></a> with the added
|
|
point as an argument does not necessarily return <tt>true</tt>.</p>
|
|
<p>The <a href="../classes/Rectangle.html#contains-point"><tt>rectangle.contains(point)</tt></a> method does not return <tt>true</tt>
|
|
for points on the right or bottom edges of a rectangle. Therefore, if the
|
|
added point falls on the left or bottom edge of the enlarged rectangle,
|
|
<a href="../classes/Rectangle.html#contains-point"><tt>rectangle.contains(point)</tt></a> returns <tt>false</tt> for that point.</p>
|
|
|
|
<ul><b>Parameters:</b>
|
|
|
|
<li>
|
|
<tt>point:</tt>
|
|
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- =========================== copyright notice ========================= -->
|
|
<p class="footer">Copyright © 21011 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
|
|
</body> |