Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1653 lines
31 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Rectangle</title>
  6. <base target="class-frame">
  7. <link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
  8. <script src="../assets/js/paper.js"></script>
  9. <script src="../assets/js/jquery.js"></script>
  10. <script src="../assets/js/codemirror.js"></script>
  11. <script src="../assets/js/docs.js"></script>
  12. </head>
  13. <body>
  14. <article class="reference">
  15. <div class="reference-class">
  16. <h1>Rectangle</h1>
  17. <p>A Rectangle specifies an area that is enclosed by it&rsquo;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>
  18. </div>
  19. <!-- =============================== constructors ========================== -->
  20. <div class="reference-members">
  21. <h2>Constructors</h2>
  22. <div id="rectangle-point-size" class="member">
  23. <div class="member-link">
  24. <a name="rectangle-point-size" href="#rectangle-point-size"><tt><b>Rectangle</b>(point, size)</tt></a>
  25. </div>
  26. <div class="member-description hidden">
  27. <div class="member-text">
  28. <p>Creates a Rectangle object.</p>
  29. <ul class="member-list">
  30. <h4>Parameters:</h4>
  31. <li>
  32. <tt>point:</tt>
  33. <a href="../classes/Point.html"><tt>Point</tt></a>
  34. &mdash;&nbsp;the top-left point of the rectangle
  35. </li>
  36. <li>
  37. <tt>size:</tt>
  38. <a href="../classes/Size.html"><tt>Size</tt></a>
  39. &mdash;&nbsp;the size of the rectangle
  40. </li>
  41. </ul>
  42. <ul class="member-list">
  43. <h4>Returns:</h4>
  44. <li>
  45. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>
  46. </li>
  47. </ul>
  48. </div>
  49. </div>
  50. </div>
  51. <div id="rectangle-object" class="member">
  52. <div class="member-link">
  53. <a name="rectangle-object" href="#rectangle-object"><tt><b>Rectangle</b>(object)</tt></a>
  54. </div>
  55. <div class="member-description hidden">
  56. <div class="member-text">
  57. <p>Creates a Rectangle object.</p>
  58. <ul class="member-list">
  59. <h4>Parameters:</h4>
  60. <li>
  61. <tt>object:</tt>
  62. <tt>Object</tt>
  63. &mdash;&nbsp;an object containing properties to be set on the rectangle
  64. </li>
  65. </ul>
  66. <ul class="member-list">
  67. <h4>Returns:</h4>
  68. <li>
  69. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>
  70. </li>
  71. </ul>
  72. <h4>Example:<span class="description">Create a rectangle between {x: 20, y: 20} and {x: 80, y:80}</span></h4>
  73. <pre><code>var rectangle = new Rectangle({
  74. point: [20, 20],
  75. size: [60, 60]
  76. });</code></pre>
  77. <h4>Example:<span class="description">Create a rectangle between {x: 20, y: 20} and {x: 80, y:80}</span></h4>
  78. <pre><code>var rectangle = new Rectangle({
  79. from: [20, 20],
  80. to: [80, 80]
  81. });</code></pre>
  82. </div>
  83. </div>
  84. </div>
  85. <div id="rectangle-x-y-width-height" class="member">
  86. <div class="member-link">
  87. <a name="rectangle-x-y-width-height" href="#rectangle-x-y-width-height"><tt><b>Rectangle</b>(x, y, width, height)</tt></a>
  88. </div>
  89. <div class="member-description hidden">
  90. <div class="member-text">
  91. <p>Creates a rectangle object.</p>
  92. <ul class="member-list">
  93. <h4>Parameters:</h4>
  94. <li>
  95. <tt>x:</tt>
  96. <tt>Number</tt>
  97. &mdash;&nbsp;the left coordinate
  98. </li>
  99. <li>
  100. <tt>y:</tt>
  101. <tt>Number</tt>
  102. &mdash;&nbsp;the top coordinate
  103. </li>
  104. <li>
  105. <tt>width:</tt>
  106. <tt>Number</tt>
  107. </li>
  108. <li>
  109. <tt>height:</tt>
  110. <tt>Number</tt>
  111. </li>
  112. </ul>
  113. <ul class="member-list">
  114. <h4>Returns:</h4>
  115. <li>
  116. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>
  117. </li>
  118. </ul>
  119. </div>
  120. </div>
  121. </div>
  122. <div id="rectangle-from-to" class="member">
  123. <div class="member-link">
  124. <a name="rectangle-from-to" href="#rectangle-from-to"><tt><b>Rectangle</b>(from, to)</tt></a>
  125. </div>
  126. <div class="member-description hidden">
  127. <div class="member-text">
  128. <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>
  129. <ul class="member-list">
  130. <h4>Parameters:</h4>
  131. <li>
  132. <tt>from:</tt>
  133. <a href="../classes/Point.html"><tt>Point</tt></a>
  134. &mdash;&nbsp;the first point defining the rectangle
  135. </li>
  136. <li>
  137. <tt>to:</tt>
  138. <a href="../classes/Point.html"><tt>Point</tt></a>
  139. &mdash;&nbsp;the second point defining the rectangle
  140. </li>
  141. </ul>
  142. <ul class="member-list">
  143. <h4>Returns:</h4>
  144. <li>
  145. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>
  146. </li>
  147. </ul>
  148. </div>
  149. </div>
  150. </div>
  151. <div id="rectangle-rectangle" class="member">
  152. <div class="member-link">
  153. <a name="rectangle-rectangle" href="#rectangle-rectangle"><tt><b>Rectangle</b>(rectangle)</tt></a>
  154. </div>
  155. <div class="member-description hidden">
  156. <div class="member-text">
  157. <p>Creates a new rectangle object from the passed rectangle object.</p>
  158. <ul class="member-list">
  159. <h4>Parameters:</h4>
  160. <li>
  161. <tt>rectangle:</tt>
  162. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  163. </li>
  164. </ul>
  165. <ul class="member-list">
  166. <h4>Returns:</h4>
  167. <li>
  168. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>
  169. </li>
  170. </ul>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <!-- ================================ properties =========================== -->
  176. <div class="reference-members">
  177. <h2>Properties</h2>
  178. <div id="x" class="member">
  179. <div class="member-link">
  180. <a name="x" href="#x"><tt><b>x</b></tt></a>
  181. </div>
  182. <div class="member-description hidden">
  183. <div class="member-text">
  184. <p>The x position of the rectangle.</p>
  185. <ul class="member-list">
  186. <h4>Type:</h4>
  187. <li>
  188. <tt>Number</tt>
  189. </li>
  190. </ul>
  191. </div>
  192. </div>
  193. </div>
  194. <div id="y" class="member">
  195. <div class="member-link">
  196. <a name="y" href="#y"><tt><b>y</b></tt></a>
  197. </div>
  198. <div class="member-description hidden">
  199. <div class="member-text">
  200. <p>The y position of the rectangle.</p>
  201. <ul class="member-list">
  202. <h4>Type:</h4>
  203. <li>
  204. <tt>Number</tt>
  205. </li>
  206. </ul>
  207. </div>
  208. </div>
  209. </div>
  210. <div id="width" class="member">
  211. <div class="member-link">
  212. <a name="width" href="#width"><tt><b>width</b></tt></a>
  213. </div>
  214. <div class="member-description hidden">
  215. <div class="member-text">
  216. <p>The width of the rectangle.</p>
  217. <ul class="member-list">
  218. <h4>Type:</h4>
  219. <li>
  220. <tt>Number</tt>
  221. </li>
  222. </ul>
  223. </div>
  224. </div>
  225. </div>
  226. <div id="height" class="member">
  227. <div class="member-link">
  228. <a name="height" href="#height"><tt><b>height</b></tt></a>
  229. </div>
  230. <div class="member-description hidden">
  231. <div class="member-text">
  232. <p>The height of the rectangle.</p>
  233. <ul class="member-list">
  234. <h4>Type:</h4>
  235. <li>
  236. <tt>Number</tt>
  237. </li>
  238. </ul>
  239. </div>
  240. </div>
  241. </div>
  242. <div id="point" class="member">
  243. <div class="member-link">
  244. <a name="point" href="#point"><tt><b>point</b></tt></a>
  245. </div>
  246. <div class="member-description hidden">
  247. <div class="member-text">
  248. <p>The top-left point of the rectangle</p>
  249. <ul class="member-list">
  250. <h4>Type:</h4>
  251. <li>
  252. <a href="../classes/Point.html"><tt>Point</tt></a>
  253. </li>
  254. </ul>
  255. </div>
  256. </div>
  257. </div>
  258. <div id="size" class="member">
  259. <div class="member-link">
  260. <a name="size" href="#size"><tt><b>size</b></tt></a>
  261. </div>
  262. <div class="member-description hidden">
  263. <div class="member-text">
  264. <p>The size of the rectangle</p>
  265. <ul class="member-list">
  266. <h4>Type:</h4>
  267. <li>
  268. <a href="../classes/Size.html"><tt>Size</tt></a>
  269. </li>
  270. </ul>
  271. </div>
  272. </div>
  273. </div>
  274. <h3>Side Positions</h3>
  275. <div id="left" class="member">
  276. <div class="member-link">
  277. <a name="left" href="#left"><tt><b>left</b></tt></a>
  278. </div>
  279. <div class="member-description hidden">
  280. <div class="member-text">
  281. <p>The position of the left hand side of the rectangle. Note that this doesn&rsquo;t move the whole rectangle; the right hand side stays where it was.</p>
  282. <ul class="member-list">
  283. <h4>Type:</h4>
  284. <li>
  285. <tt>Number</tt>
  286. </li>
  287. </ul>
  288. </div>
  289. </div>
  290. </div>
  291. <div id="top" class="member">
  292. <div class="member-link">
  293. <a name="top" href="#top"><tt><b>top</b></tt></a>
  294. </div>
  295. <div class="member-description hidden">
  296. <div class="member-text">
  297. <p>The top coordinate of the rectangle. Note that this doesn&rsquo;t move the whole rectangle: the bottom won&rsquo;t move.</p>
  298. <ul class="member-list">
  299. <h4>Type:</h4>
  300. <li>
  301. <tt>Number</tt>
  302. </li>
  303. </ul>
  304. </div>
  305. </div>
  306. </div>
  307. <div id="right" class="member">
  308. <div class="member-link">
  309. <a name="right" href="#right"><tt><b>right</b></tt></a>
  310. </div>
  311. <div class="member-description hidden">
  312. <div class="member-text">
  313. <p>The position of the right hand side of the rectangle. Note that this doesn&rsquo;t move the whole rectangle; the left hand side stays where it was.</p>
  314. <ul class="member-list">
  315. <h4>Type:</h4>
  316. <li>
  317. <tt>Number</tt>
  318. </li>
  319. </ul>
  320. </div>
  321. </div>
  322. </div>
  323. <div id="bottom" class="member">
  324. <div class="member-link">
  325. <a name="bottom" href="#bottom"><tt><b>bottom</b></tt></a>
  326. </div>
  327. <div class="member-description hidden">
  328. <div class="member-text">
  329. <p>The bottom coordinate of the rectangle. Note that this doesn&rsquo;t move the whole rectangle: the top won&rsquo;t move.</p>
  330. <ul class="member-list">
  331. <h4>Type:</h4>
  332. <li>
  333. <tt>Number</tt>
  334. </li>
  335. </ul>
  336. </div>
  337. </div>
  338. </div>
  339. <h3>Corner and Center Point Positions</h3>
  340. <div id="center" class="member">
  341. <div class="member-link">
  342. <a name="center" href="#center"><tt><b>center</b></tt></a>
  343. </div>
  344. <div class="member-description hidden">
  345. <div class="member-text">
  346. <p>The center point of the rectangle.</p>
  347. <ul class="member-list">
  348. <h4>Type:</h4>
  349. <li>
  350. <a href="../classes/Point.html"><tt>Point</tt></a>
  351. </li>
  352. </ul>
  353. </div>
  354. </div>
  355. </div>
  356. <div id="topleft" class="member">
  357. <div class="member-link">
  358. <a name="topleft" href="#topleft"><tt><b>topLeft</b></tt></a>
  359. </div>
  360. <div class="member-description hidden">
  361. <div class="member-text">
  362. <p>The top-left point of the rectangle.</p>
  363. <ul class="member-list">
  364. <h4>Type:</h4>
  365. <li>
  366. <a href="../classes/Point.html"><tt>Point</tt></a>
  367. </li>
  368. </ul>
  369. </div>
  370. </div>
  371. </div>
  372. <div id="topright" class="member">
  373. <div class="member-link">
  374. <a name="topright" href="#topright"><tt><b>topRight</b></tt></a>
  375. </div>
  376. <div class="member-description hidden">
  377. <div class="member-text">
  378. <p>The top-right point of the rectangle.</p>
  379. <ul class="member-list">
  380. <h4>Type:</h4>
  381. <li>
  382. <a href="../classes/Point.html"><tt>Point</tt></a>
  383. </li>
  384. </ul>
  385. </div>
  386. </div>
  387. </div>
  388. <div id="bottomleft" class="member">
  389. <div class="member-link">
  390. <a name="bottomleft" href="#bottomleft"><tt><b>bottomLeft</b></tt></a>
  391. </div>
  392. <div class="member-description hidden">
  393. <div class="member-text">
  394. <p>The bottom-left point of the rectangle.</p>
  395. <ul class="member-list">
  396. <h4>Type:</h4>
  397. <li>
  398. <a href="../classes/Point.html"><tt>Point</tt></a>
  399. </li>
  400. </ul>
  401. </div>
  402. </div>
  403. </div>
  404. <div id="bottomright" class="member">
  405. <div class="member-link">
  406. <a name="bottomright" href="#bottomright"><tt><b>bottomRight</b></tt></a>
  407. </div>
  408. <div class="member-description hidden">
  409. <div class="member-text">
  410. <p>The bottom-right point of the rectangle.</p>
  411. <ul class="member-list">
  412. <h4>Type:</h4>
  413. <li>
  414. <a href="../classes/Point.html"><tt>Point</tt></a>
  415. </li>
  416. </ul>
  417. </div>
  418. </div>
  419. </div>
  420. <div id="leftcenter" class="member">
  421. <div class="member-link">
  422. <a name="leftcenter" href="#leftcenter"><tt><b>leftCenter</b></tt></a>
  423. </div>
  424. <div class="member-description hidden">
  425. <div class="member-text">
  426. <p>The left-center point of the rectangle.</p>
  427. <ul class="member-list">
  428. <h4>Type:</h4>
  429. <li>
  430. <a href="../classes/Point.html"><tt>Point</tt></a>
  431. </li>
  432. </ul>
  433. </div>
  434. </div>
  435. </div>
  436. <div id="topcenter" class="member">
  437. <div class="member-link">
  438. <a name="topcenter" href="#topcenter"><tt><b>topCenter</b></tt></a>
  439. </div>
  440. <div class="member-description hidden">
  441. <div class="member-text">
  442. <p>The top-center point of the rectangle.</p>
  443. <ul class="member-list">
  444. <h4>Type:</h4>
  445. <li>
  446. <a href="../classes/Point.html"><tt>Point</tt></a>
  447. </li>
  448. </ul>
  449. </div>
  450. </div>
  451. </div>
  452. <div id="rightcenter" class="member">
  453. <div class="member-link">
  454. <a name="rightcenter" href="#rightcenter"><tt><b>rightCenter</b></tt></a>
  455. </div>
  456. <div class="member-description hidden">
  457. <div class="member-text">
  458. <p>The right-center point of the rectangle.</p>
  459. <ul class="member-list">
  460. <h4>Type:</h4>
  461. <li>
  462. <a href="../classes/Point.html"><tt>Point</tt></a>
  463. </li>
  464. </ul>
  465. </div>
  466. </div>
  467. </div>
  468. <div id="bottomcenter" class="member">
  469. <div class="member-link">
  470. <a name="bottomcenter" href="#bottomcenter"><tt><b>bottomCenter</b></tt></a>
  471. </div>
  472. <div class="member-description hidden">
  473. <div class="member-text">
  474. <p>The bottom-center point of the rectangle.</p>
  475. <ul class="member-list">
  476. <h4>Type:</h4>
  477. <li>
  478. <a href="../classes/Point.html"><tt>Point</tt></a>
  479. </li>
  480. </ul>
  481. </div>
  482. </div>
  483. </div>
  484. <div id="area" class="member">
  485. <div class="member-link">
  486. <a name="area" href="#area"><tt><b>area</b></tt></a>
  487. </div>
  488. <div class="member-description hidden">
  489. <div class="member-text">
  490. <p>The area of the rectangle.</p>
  491. <p>Read only.</p>
  492. <ul class="member-list">
  493. <h4>Type:</h4>
  494. <li>
  495. <tt>Number</tt>
  496. </li>
  497. </ul>
  498. </div>
  499. </div>
  500. </div>
  501. <h3>Item Bounds</h3>
  502. <div id="selected" class="member">
  503. <div class="member-link">
  504. <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
  505. </div>
  506. <div class="member-description hidden">
  507. <div class="member-text">
  508. <p>Specifies whether an item&rsquo;s bounds are to appear as selected.</p>
  509. <p>Paper.js draws the bounds of items with selected bounds on top of your project. This is very useful when debugging.</p>
  510. <ul class="member-list">
  511. <h4>Default:</h4>
  512. <li><tt>false</tt></li>
  513. </ul>
  514. <ul class="member-list">
  515. <h4>Type:</h4>
  516. <li>
  517. <tt>Boolean</tt>
  518. </li>
  519. </ul>
  520. <h4>Example:</h4>
  521. <div class="paperscript split">
  522. <div class="buttons">
  523. <div class="button run">Run</div>
  524. </div>
  525. <script type="text/paperscript" canvas="canvas-0">
  526. var path = new Path.Circle({
  527. center: [80, 50],
  528. radius: 40,
  529. selected: true
  530. });
  531. path.bounds.selected = true;
  532. </script>
  533. <div class="canvas"><canvas width="516" height="100" id="canvas-0"></canvas></div>
  534. </div>
  535. </div>
  536. </div>
  537. </div>
  538. </div>
  539. <!-- ============================== methods ================================ -->
  540. <div class="reference-members">
  541. <h2>Methods</h2>
  542. <div id="set-values" class="member">
  543. <div class="member-link">
  544. <a name="set-values" href="#set-values"><tt><b>set</b>(...values)</tt></a>
  545. </div>
  546. <div class="member-description hidden">
  547. <div class="member-text">
  548. <p>Sets the rectangle to the passed values. Note that any sequence of parameters that is supported by the various <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>() constructors also work for calls of <code>set()</code>.</p>
  549. <ul class="member-list">
  550. <h4>Parameters:</h4>
  551. <li>
  552. <tt>values:</tt>
  553. <tt>any value</tt>
  554. </li>
  555. </ul>
  556. <ul class="member-list">
  557. <h4>Returns:</h4>
  558. <li>
  559. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>
  560. </li>
  561. </ul>
  562. </div>
  563. </div>
  564. </div>
  565. <div id="clone" class="member">
  566. <div class="member-link">
  567. <a name="clone" href="#clone"><tt><b>clone</b>()</tt></a>
  568. </div>
  569. <div class="member-description hidden">
  570. <div class="member-text">
  571. <p>Returns a copy of the rectangle.</p>
  572. <ul class="member-list">
  573. <h4>Returns:</h4>
  574. <li>
  575. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>
  576. </li>
  577. </ul>
  578. </div>
  579. </div>
  580. </div>
  581. <div id="equals-rect" class="member">
  582. <div class="member-link">
  583. <a name="equals-rect" href="#equals-rect"><tt><b>equals</b>(rect)</tt></a>
  584. </div>
  585. <div class="member-description hidden">
  586. <div class="member-text">
  587. <p>Checks whether the coordinates and size of the rectangle are equal to that of the supplied rectangle.</p>
  588. <ul class="member-list">
  589. <h4>Parameters:</h4>
  590. <li>
  591. <tt>rect:</tt>
  592. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  593. </li>
  594. </ul>
  595. <ul class="member-list">
  596. <h4>Returns:</h4>
  597. <li>
  598. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the rectangles are equal, <tt>false</tt> otherwise
  599. </li>
  600. </ul>
  601. </div>
  602. </div>
  603. </div>
  604. <div id="tostring" class="member">
  605. <div class="member-link">
  606. <a name="tostring" href="#tostring"><tt><b>toString</b>()</tt></a>
  607. </div>
  608. <div class="member-description hidden">
  609. <div class="member-text">
  610. <ul class="member-list">
  611. <h4>Returns:</h4>
  612. <li>
  613. <tt><tt>String</tt></tt>&nbsp;&mdash;&nbsp;a string representation of this rectangle
  614. </li>
  615. </ul>
  616. </div>
  617. </div>
  618. </div>
  619. <div id="isempty" class="member">
  620. <div class="member-link">
  621. <a name="isempty" href="#isempty"><tt><b>isEmpty</b>()</tt></a>
  622. </div>
  623. <div class="member-description hidden">
  624. <div class="member-text">
  625. <ul class="member-list">
  626. <h4>Returns:</h4>
  627. <li>
  628. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the rectangle is empty, <tt>false</tt> otherwise
  629. </li>
  630. </ul>
  631. </div>
  632. </div>
  633. </div>
  634. <h3>Geometric Tests</h3>
  635. <div id="contains-point" class="member">
  636. <div class="member-link">
  637. <a name="contains-point" href="#contains-point"><tt><b>contains</b>(point)</tt></a>
  638. </div>
  639. <div class="member-description hidden">
  640. <div class="member-text">
  641. <p>Tests if the specified point is inside the boundary of the rectangle.</p>
  642. <ul class="member-list">
  643. <h4>Parameters:</h4>
  644. <li>
  645. <tt>point:</tt>
  646. <a href="../classes/Point.html"><tt>Point</tt></a>
  647. &mdash;&nbsp;the specified point
  648. </li>
  649. </ul>
  650. <ul class="member-list">
  651. <h4>Returns:</h4>
  652. <li>
  653. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the point is inside the rectangle&rsquo;s boundary, <tt>false</tt> otherwise
  654. </li>
  655. </ul>
  656. <h4>Example:<span class="description">Checking whether the mouse position falls within the bounding rectangle of an item:</span></h4>
  657. <div class="paperscript split">
  658. <div class="buttons">
  659. <div class="button run">Run</div>
  660. </div>
  661. <script type="text/paperscript" canvas="canvas-1">
  662. // Create a circle shaped path at {x: 80, y: 50}
  663. // with a radius of 30.
  664. var circle = new Path.Circle(new Point(80, 50), 30);
  665. circle.fillColor = 'red';
  666. function onMouseMove(event) {
  667. // Check whether the mouse position intersects with the
  668. // bounding box of the item:
  669. if (circle.bounds.contains(event.point)) {
  670. // If it intersects, fill it with green:
  671. circle.fillColor = 'green';
  672. } else {
  673. // If it doesn't intersect, fill it with red:
  674. circle.fillColor = 'red';
  675. }
  676. }
  677. </script>
  678. <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
  679. </div>
  680. </div>
  681. </div>
  682. </div>
  683. <div id="contains-rect" class="member">
  684. <div class="member-link">
  685. <a name="contains-rect" href="#contains-rect"><tt><b>contains</b>(rect)</tt></a>
  686. </div>
  687. <div class="member-description hidden">
  688. <div class="member-text">
  689. <p>Tests if the interior of the rectangle entirely contains the specified rectangle.</p>
  690. <ul class="member-list">
  691. <h4>Parameters:</h4>
  692. <li>
  693. <tt>rect:</tt>
  694. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  695. &mdash;&nbsp;the specified rectangle
  696. </li>
  697. </ul>
  698. <ul class="member-list">
  699. <h4>Returns:</h4>
  700. <li>
  701. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the rectangle entirely contains the specified rectangle, <tt>false</tt> otherwise
  702. </li>
  703. </ul>
  704. <h4>Example:<span class="description">Checking whether the bounding box of one item is contained within that of another item:</span></h4>
  705. <div class="paperscript split">
  706. <div class="buttons">
  707. <div class="button run">Run</div>
  708. </div>
  709. <script type="text/paperscript" canvas="canvas-2">
  710. // All newly created paths will inherit these styles:
  711. project.currentStyle = {
  712. fillColor: 'green',
  713. strokeColor: 'black'
  714. };
  715. // Create a circle shaped path at {x: 80, y: 50}
  716. // with a radius of 45.
  717. var largeCircle = new Path.Circle(new Point(80, 50), 45);
  718. // Create a smaller circle shaped path in the same position
  719. // with a radius of 30.
  720. var circle = new Path.Circle(new Point(80, 50), 30);
  721. function onMouseMove(event) {
  722. // Move the circle to the position of the mouse:
  723. circle.position = event.point;
  724. // Check whether the bounding box of the smaller circle
  725. // is contained within the bounding box of the larger item:
  726. if (largeCircle.bounds.contains(circle.bounds)) {
  727. // If it does, fill it with green:
  728. circle.fillColor = 'green';
  729. largeCircle.fillColor = 'green';
  730. } else {
  731. // If doesn't, fill it with red:
  732. circle.fillColor = 'red';
  733. largeCircle.fillColor = 'red';
  734. }
  735. }
  736. </script>
  737. <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
  738. </div>
  739. </div>
  740. </div>
  741. </div>
  742. <div id="intersects-rect" class="member">
  743. <div class="member-link">
  744. <a name="intersects-rect" href="#intersects-rect"><tt><b>intersects</b>(rect[, epsilon])</tt></a>
  745. </div>
  746. <div class="member-description hidden">
  747. <div class="member-text">
  748. <p>Tests if the interior of this rectangle intersects the interior of another rectangle. Rectangles just touching each other are considered as non-intersecting, except if a <code>epsilon</code> value is specified by which this rectangle&rsquo;s dimensions are increased before comparing.</p>
  749. <ul class="member-list">
  750. <h4>Parameters:</h4>
  751. <li>
  752. <tt>rect:</tt>
  753. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  754. &mdash;&nbsp;the specified rectangle
  755. </li>
  756. <li>
  757. <tt>epsilon:</tt>
  758. <tt>Number</tt>
  759. &mdash;&nbsp;the epsilon against which to compare the rectangle&rsquo;s dimensions
  760. &mdash;&nbsp;optional, default: <tt>0</tt>
  761. </li>
  762. </ul>
  763. <ul class="member-list">
  764. <h4>Returns:</h4>
  765. <li>
  766. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the rectangle and the specified rectangle intersect each other, <tt>false</tt> otherwise
  767. </li>
  768. </ul>
  769. <h4>Example:<span class="description">Checking whether the bounding box of one item intersects with that of another item:</span></h4>
  770. <div class="paperscript split">
  771. <div class="buttons">
  772. <div class="button run">Run</div>
  773. </div>
  774. <script type="text/paperscript" canvas="canvas-3">
  775. // All newly created paths will inherit these styles:
  776. project.currentStyle = {
  777. fillColor: 'green',
  778. strokeColor: 'black'
  779. };
  780. // Create a circle shaped path at {x: 80, y: 50}
  781. // with a radius of 45.
  782. var largeCircle = new Path.Circle(new Point(80, 50), 45);
  783. // Create a smaller circle shaped path in the same position
  784. // with a radius of 30.
  785. var circle = new Path.Circle(new Point(80, 50), 30);
  786. function onMouseMove(event) {
  787. // Move the circle to the position of the mouse:
  788. circle.position = event.point;
  789. // Check whether the bounding box of the two circle
  790. // shaped paths intersect:
  791. if (largeCircle.bounds.intersects(circle.bounds)) {
  792. // If it does, fill it with green:
  793. circle.fillColor = 'green';
  794. largeCircle.fillColor = 'green';
  795. } else {
  796. // If doesn't, fill it with red:
  797. circle.fillColor = 'red';
  798. largeCircle.fillColor = 'red';
  799. }
  800. }
  801. </script>
  802. <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
  803. </div>
  804. </div>
  805. </div>
  806. </div>
  807. <h3>Boolean Operations</h3>
  808. <div id="intersect-rect" class="member">
  809. <div class="member-link">
  810. <a name="intersect-rect" href="#intersect-rect"><tt><b>intersect</b>(rect)</tt></a>
  811. </div>
  812. <div class="member-description hidden">
  813. <div class="member-text">
  814. <p>Returns a new rectangle representing the intersection of this rectangle with the specified rectangle.</p>
  815. <ul class="member-list">
  816. <h4>Parameters:</h4>
  817. <li>
  818. <tt>rect:</tt>
  819. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  820. &mdash;&nbsp;the rectangle to be intersected with this rectangle
  821. </li>
  822. </ul>
  823. <ul class="member-list">
  824. <h4>Returns:</h4>
  825. <li>
  826. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>&nbsp;&mdash;&nbsp;the largest rectangle contained in both the specified rectangle and in this rectangle
  827. </li>
  828. </ul>
  829. <h4>Example:<span class="description">Intersecting two rectangles and visualizing the result using rectangle shaped paths:</span></h4>
  830. <div class="paperscript split">
  831. <div class="buttons">
  832. <div class="button run">Run</div>
  833. </div>
  834. <script type="text/paperscript" canvas="canvas-4">
  835. // Create two rectangles that overlap each other
  836. var size = new Size(50, 50);
  837. var rectangle1 = new Rectangle(new Point(25, 15), size);
  838. var rectangle2 = new Rectangle(new Point(50, 40), size);
  839. // The rectangle that represents the intersection of the
  840. // two rectangles:
  841. var intersected = rectangle1.intersect(rectangle2);
  842. // To visualize the intersecting of the rectangles, we will
  843. // create rectangle shaped paths using the Path.Rectangle
  844. // constructor.
  845. // Have all newly created paths inherit a black stroke:
  846. project.currentStyle.strokeColor = 'black';
  847. // Create two rectangle shaped paths using the abstract rectangles
  848. // we created before:
  849. new Path.Rectangle(rectangle1);
  850. new Path.Rectangle(rectangle2);
  851. // Create a path that represents the intersected rectangle,
  852. // and fill it with red:
  853. var intersectionPath = new Path.Rectangle(intersected);
  854. intersectionPath.fillColor = 'red';
  855. </script>
  856. <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
  857. </div>
  858. </div>
  859. </div>
  860. </div>
  861. <div id="unite-rect" class="member">
  862. <div class="member-link">
  863. <a name="unite-rect" href="#unite-rect"><tt><b>unite</b>(rect)</tt></a>
  864. </div>
  865. <div class="member-description hidden">
  866. <div class="member-text">
  867. <p>Returns a new rectangle representing the union of this rectangle with the specified rectangle.</p>
  868. <ul class="member-list">
  869. <h4>Parameters:</h4>
  870. <li>
  871. <tt>rect:</tt>
  872. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  873. &mdash;&nbsp;the rectangle to be combined with this rectangle
  874. </li>
  875. </ul>
  876. <ul class="member-list">
  877. <h4>Returns:</h4>
  878. <li>
  879. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>&nbsp;&mdash;&nbsp;the smallest rectangle containing both the specified rectangle and this rectangle
  880. </li>
  881. </ul>
  882. </div>
  883. </div>
  884. </div>
  885. <div id="include-point" class="member">
  886. <div class="member-link">
  887. <a name="include-point" href="#include-point"><tt><b>include</b>(point)</tt></a>
  888. </div>
  889. <div class="member-description hidden">
  890. <div class="member-text">
  891. <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>
  892. <p>After adding a point, a call to <a href="../classes/Rectangle.html#contains-point"><tt>contains(point)</tt></a> with the added point as an argument does not necessarily return <code>true</code>. The <a href="../classes/Rectangle.html#contains-point"><tt>rectangle.contains(point)</tt></a> method does not return <code>true</code> 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 <code>false</code> for that point.</p>
  893. <ul class="member-list">
  894. <h4>Parameters:</h4>
  895. <li>
  896. <tt>point:</tt>
  897. <a href="../classes/Point.html"><tt>Point</tt></a>
  898. </li>
  899. </ul>
  900. <ul class="member-list">
  901. <h4>Returns:</h4>
  902. <li>
  903. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>&nbsp;&mdash;&nbsp;the smallest rectangle that contains both the original rectangle and the specified point
  904. </li>
  905. </ul>
  906. </div>
  907. </div>
  908. </div>
  909. <div id="expand-amount" class="member">
  910. <div class="member-link">
  911. <a name="expand-amount" href="#expand-amount"><tt><b>expand</b>(amount)</tt></a>
  912. </div>
  913. <div class="member-description hidden">
  914. <div class="member-text">
  915. <p>Returns a new rectangle expanded by the specified amount in horizontal and vertical directions.</p>
  916. <ul class="member-list">
  917. <h4>Parameters:</h4>
  918. <li>
  919. <tt>amount:</tt>
  920. <tt>Number</tt>⟋<a href="../classes/Size.html"><tt>Size</tt></a>⟋<a href="../classes/Point.html"><tt>Point</tt></a>
  921. &mdash;&nbsp;the amount to expand the rectangle in both directions
  922. </li>
  923. </ul>
  924. <ul class="member-list">
  925. <h4>Returns:</h4>
  926. <li>
  927. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>&nbsp;&mdash;&nbsp;the expanded rectangle
  928. </li>
  929. </ul>
  930. </div>
  931. </div>
  932. </div>
  933. <div id="expand-hor-ver" class="member">
  934. <div class="member-link">
  935. <a name="expand-hor-ver" href="#expand-hor-ver"><tt><b>expand</b>(hor, ver)</tt></a>
  936. </div>
  937. <div class="member-description hidden">
  938. <div class="member-text">
  939. <p>Returns a new rectangle expanded by the specified amounts in horizontal and vertical directions.</p>
  940. <ul class="member-list">
  941. <h4>Parameters:</h4>
  942. <li>
  943. <tt>hor:</tt>
  944. <tt>Number</tt>
  945. &mdash;&nbsp;the amount to expand the rectangle in horizontal direction
  946. </li>
  947. <li>
  948. <tt>ver:</tt>
  949. <tt>Number</tt>
  950. &mdash;&nbsp;the amount to expand the rectangle in vertical direction
  951. </li>
  952. </ul>
  953. <ul class="member-list">
  954. <h4>Returns:</h4>
  955. <li>
  956. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>&nbsp;&mdash;&nbsp;the expanded rectangle
  957. </li>
  958. </ul>
  959. </div>
  960. </div>
  961. </div>
  962. <div id="scale-amount" class="member">
  963. <div class="member-link">
  964. <a name="scale-amount" href="#scale-amount"><tt><b>scale</b>(amount)</tt></a>
  965. </div>
  966. <div class="member-description hidden">
  967. <div class="member-text">
  968. <p>Returns a new rectangle scaled by the specified amount from its center.</p>
  969. <ul class="member-list">
  970. <h4>Parameters:</h4>
  971. <li>
  972. <tt>amount:</tt>
  973. <tt>Number</tt>
  974. </li>
  975. </ul>
  976. <ul class="member-list">
  977. <h4>Returns:</h4>
  978. <li>
  979. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>&nbsp;&mdash;&nbsp;the scaled rectangle
  980. </li>
  981. </ul>
  982. </div>
  983. </div>
  984. </div>
  985. <div id="scale-hor-ver" class="member">
  986. <div class="member-link">
  987. <a name="scale-hor-ver" href="#scale-hor-ver"><tt><b>scale</b>(hor, ver)</tt></a>
  988. </div>
  989. <div class="member-description hidden">
  990. <div class="member-text">
  991. <p>Returns a new rectangle scaled in horizontal direction by the specified <code>hor</code> amount and in vertical direction by the specified <code>ver</code> amount from its center.</p>
  992. <ul class="member-list">
  993. <h4>Parameters:</h4>
  994. <li>
  995. <tt>hor:</tt>
  996. <tt>Number</tt>
  997. </li>
  998. <li>
  999. <tt>ver:</tt>
  1000. <tt>Number</tt>
  1001. </li>
  1002. </ul>
  1003. <ul class="member-list">
  1004. <h4>Returns:</h4>
  1005. <li>
  1006. <tt><a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt>&nbsp;&mdash;&nbsp;the scaled rectangle
  1007. </li>
  1008. </ul>
  1009. </div>
  1010. </div>
  1011. </div>
  1012. </div>
  1013. <!-- =========================== copyright notice ========================== -->
  1014. <p class="footer">
  1015. Paper.js v0.12.15<br>
  1016. Copyright &#169; 2011—2021 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
  1017. <div class="content-end"></div>
  1018. </article>
  1019. </body>