paper 0.16.0 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/CHANGELOG.md +294 -0
  2. package/LICENSE.txt +1 -1
  3. package/MIGRATION.md +402 -0
  4. package/README.md +137 -143
  5. package/dist/esm/anim/Tween.js +404 -0
  6. package/dist/esm/basic/Line.js +252 -0
  7. package/dist/esm/basic/Matrix.js +603 -0
  8. package/dist/esm/basic/Point.js +738 -0
  9. package/dist/esm/basic/Rectangle.js +788 -0
  10. package/dist/esm/basic/Size.js +368 -0
  11. package/dist/esm/boolean/graph.js +950 -0
  12. package/dist/esm/boolean/index.js +143 -0
  13. package/dist/esm/boolean/operations.js +94 -0
  14. package/dist/esm/boolean/split.js +89 -0
  15. package/dist/esm/canvas/blendModes.js +115 -0
  16. package/dist/esm/canvas/canvasProvider.js +102 -0
  17. package/dist/esm/constants.js +130 -0
  18. package/dist/esm/core/Base.js +52 -0
  19. package/dist/esm/core/Emitter.js +215 -0
  20. package/dist/esm/core/features.js +53 -0
  21. package/dist/esm/core/serialization.js +174 -0
  22. package/dist/esm/core.js +15 -0
  23. package/dist/esm/dom/domElement.js +112 -0
  24. package/dist/esm/dom/domEvent.js +106 -0
  25. package/dist/esm/env.js +66 -0
  26. package/dist/esm/event/DrawEvent.js +38 -0
  27. package/dist/esm/event/Event.js +79 -0
  28. package/dist/esm/event/Key.js +236 -0
  29. package/dist/esm/event/KeyEvent.js +39 -0
  30. package/dist/esm/event/MouseEvent.js +91 -0
  31. package/dist/esm/hosted/HostItem.js +60 -0
  32. package/dist/esm/hosted/Hosting.js +1061 -0
  33. package/dist/esm/hosted/index.js +20 -0
  34. package/dist/esm/index.js +38 -0
  35. package/dist/esm/internal.js +115 -0
  36. package/dist/esm/item/Effect.js +256 -0
  37. package/dist/esm/item/EffectInstance.js +184 -0
  38. package/dist/esm/item/Group.js +293 -0
  39. package/dist/esm/item/HitResult.js +126 -0
  40. package/dist/esm/item/Item.js +3339 -0
  41. package/dist/esm/item/ItemDefinition.js +95 -0
  42. package/dist/esm/item/Layer.js +69 -0
  43. package/dist/esm/item/Project.js +1013 -0
  44. package/dist/esm/item/Raster.js +722 -0
  45. package/dist/esm/item/Shape.js +355 -0
  46. package/dist/esm/item/SymbolDefinition.js +68 -0
  47. package/dist/esm/item/SymbolItem.js +131 -0
  48. package/dist/esm/item/bounds.js +324 -0
  49. package/dist/esm/item/draw.js +525 -0
  50. package/dist/esm/item/effects.js +124 -0
  51. package/dist/esm/item/expand.js +87 -0
  52. package/dist/esm/item/hitTest.js +203 -0
  53. package/dist/esm/item/hosting.js +12 -0
  54. package/dist/esm/item/props.js +12 -0
  55. package/dist/esm/item/query.js +139 -0
  56. package/dist/esm/item/sampling.js +67 -0
  57. package/dist/esm/item/transform.js +128 -0
  58. package/dist/esm/net/http.js +26 -0
  59. package/dist/esm/node/CanvasAdapter.js +137 -0
  60. package/dist/esm/node/index.js +150 -0
  61. package/dist/esm/node/peers.js +27 -0
  62. package/dist/esm/offset/curves.js +866 -0
  63. package/dist/esm/offset/index.js +70 -0
  64. package/dist/esm/offset/offset.js +178 -0
  65. package/dist/esm/offset/outline.js +91 -0
  66. package/dist/esm/offset/pen.js +298 -0
  67. package/dist/esm/offset/profile.js +772 -0
  68. package/dist/esm/offset/round.js +213 -0
  69. package/dist/esm/offset/sweep.js +100 -0
  70. package/dist/esm/paperscript/PaperScript.js +832 -0
  71. package/dist/esm/paperscript/autoload.js +27 -0
  72. package/dist/esm/paperscript/index.js +17 -0
  73. package/dist/esm/path/CompoundPath.js +367 -0
  74. package/dist/esm/path/Curve.js +996 -0
  75. package/dist/esm/path/CurveLocation.js +462 -0
  76. package/dist/esm/path/Path.js +1761 -0
  77. package/dist/esm/path/PathFlattener.js +186 -0
  78. package/dist/esm/path/PathItem.js +757 -0
  79. package/dist/esm/path/Segment.js +640 -0
  80. package/dist/esm/path/SegmentPoint.js +106 -0
  81. package/dist/esm/path/StrokeProfile.js +387 -0
  82. package/dist/esm/path/StrokeProfileStop.js +207 -0
  83. package/dist/esm/path/boolean.js +284 -0
  84. package/dist/esm/path/bounds.js +257 -0
  85. package/dist/esm/path/crossing.js +114 -0
  86. package/dist/esm/path/draw.js +161 -0
  87. package/dist/esm/path/hitTest.js +259 -0
  88. package/dist/esm/path/offset.js +152 -0
  89. package/dist/esm/path/shapes.js +231 -0
  90. package/dist/esm/path/smooth.js +84 -0
  91. package/dist/esm/path/values.js +40 -0
  92. package/dist/esm/scope/PaperScope.js +288 -0
  93. package/dist/esm/scope/PaperScopeItem.js +74 -0
  94. package/dist/esm/smoothing/index.js +71 -0
  95. package/dist/esm/style/Color.js +917 -0
  96. package/dist/esm/style/Gradient.js +191 -0
  97. package/dist/esm/style/GradientStop.js +168 -0
  98. package/dist/esm/style/PatternDefinition.js +383 -0
  99. package/dist/esm/style/Style.js +503 -0
  100. package/dist/esm/svg/index.js +27 -0
  101. package/dist/esm/svg/svgElement.js +97 -0
  102. package/dist/esm/svg/svgExport.js +847 -0
  103. package/dist/esm/svg/svgImport.js +1101 -0
  104. package/dist/esm/svg/svgStyles.js +96 -0
  105. package/dist/esm/text/AreaText.js +190 -0
  106. package/dist/esm/text/PathText.js +111 -0
  107. package/dist/esm/text/PointText.js +92 -0
  108. package/dist/esm/text/TextItem.js +538 -0
  109. package/dist/esm/text/TextRange.js +169 -0
  110. package/dist/esm/text/TextStory.js +394 -0
  111. package/dist/esm/text/areaLayout.js +439 -0
  112. package/dist/esm/text/layout.js +265 -0
  113. package/dist/esm/text/measure.js +57 -0
  114. package/dist/esm/text/pathLayout.js +93 -0
  115. package/dist/esm/tool/Tool.js +284 -0
  116. package/dist/esm/tool/ToolEvent.js +232 -0
  117. package/dist/esm/util/Formatter.js +57 -0
  118. package/dist/esm/util/collisions.js +216 -0
  119. package/dist/esm/util/list.js +110 -0
  120. package/dist/esm/util/numerical.js +656 -0
  121. package/dist/esm/util/object.js +81 -0
  122. package/dist/esm/util/string.js +29 -0
  123. package/dist/esm/util/uid.js +31 -0
  124. package/dist/esm/values/arcs.js +243 -0
  125. package/dist/esm/values/curve.js +975 -0
  126. package/dist/esm/values/fit.js +290 -0
  127. package/dist/esm/values/index.js +23 -0
  128. package/dist/esm/values/intersections.js +869 -0
  129. package/dist/esm/values/matrix.js +114 -0
  130. package/dist/esm/values/path.js +174 -0
  131. package/dist/esm/values/profile.js +221 -0
  132. package/dist/esm/values/region.js +63 -0
  133. package/dist/esm/values/smooth.js +248 -0
  134. package/dist/esm/values/svg.js +287 -0
  135. package/dist/esm/view/CanvasView.js +106 -0
  136. package/dist/esm/view/View.js +775 -0
  137. package/dist/esm/view/input.js +527 -0
  138. package/dist/paper-full.js +33083 -22681
  139. package/dist/paper-full.min.js +36 -31
  140. package/dist/paper-hosted.js +33898 -23223
  141. package/dist/paper-hosted.min.js +37 -0
  142. package/dist/paper-slim.js +28581 -0
  143. package/dist/paper-slim.min.js +17 -0
  144. package/dist/types/anim/Tween.d.ts +164 -0
  145. package/dist/types/basic/Line.d.ts +136 -0
  146. package/dist/types/basic/Matrix.d.ts +387 -0
  147. package/dist/types/basic/Point.d.ts +781 -0
  148. package/dist/types/basic/Rectangle.d.ts +550 -0
  149. package/dist/types/basic/Size.d.ts +457 -0
  150. package/dist/types/boolean/graph.d.ts +123 -0
  151. package/dist/types/boolean/index.d.ts +74 -0
  152. package/dist/types/boolean/operations.d.ts +9 -0
  153. package/dist/types/boolean/split.d.ts +19 -0
  154. package/dist/types/canvas/blendModes.d.ts +18 -0
  155. package/dist/types/canvas/canvasProvider.d.ts +32 -0
  156. package/dist/types/constants.d.ts +112 -0
  157. package/dist/types/core/Base.d.ts +50 -0
  158. package/dist/types/core/Emitter.d.ts +49 -0
  159. package/dist/types/core/features.d.ts +41 -0
  160. package/dist/types/core/serialization.d.ts +44 -0
  161. package/dist/types/core.d.ts +18 -0
  162. package/dist/types/dom/domElement.d.ts +33 -0
  163. package/dist/types/dom/domEvent.d.ts +29 -0
  164. package/dist/types/env.d.ts +26 -0
  165. package/dist/types/event/DrawEvent.d.ts +27 -0
  166. package/dist/types/event/Event.d.ts +47 -0
  167. package/dist/types/event/Key.d.ts +82 -0
  168. package/dist/types/event/KeyEvent.d.ts +35 -0
  169. package/dist/types/event/MouseEvent.d.ts +78 -0
  170. package/dist/types/hosted/HostItem.d.ts +26 -0
  171. package/dist/types/hosted/Hosting.d.ts +273 -0
  172. package/dist/types/hosted/index.d.ts +10 -0
  173. package/dist/types/index.d.ts +64 -0
  174. package/dist/types/internal.d.ts +101 -0
  175. package/dist/types/item/Effect.d.ts +128 -0
  176. package/dist/types/item/EffectInstance.d.ts +81 -0
  177. package/dist/types/item/Group.d.ts +225 -0
  178. package/dist/types/item/HitResult.d.ts +94 -0
  179. package/dist/types/item/Item.d.ts +2927 -0
  180. package/dist/types/item/ItemDefinition.d.ts +25 -0
  181. package/dist/types/item/Layer.d.ts +80 -0
  182. package/dist/types/item/Project.d.ts +748 -0
  183. package/dist/types/item/Raster.d.ts +431 -0
  184. package/dist/types/item/Shape.d.ts +219 -0
  185. package/dist/types/item/SymbolDefinition.d.ts +98 -0
  186. package/dist/types/item/SymbolItem.d.ts +92 -0
  187. package/dist/types/item/bounds.d.ts +56 -0
  188. package/dist/types/item/draw.d.ts +23 -0
  189. package/dist/types/item/effects.d.ts +22 -0
  190. package/dist/types/item/expand.d.ts +7 -0
  191. package/dist/types/item/hitTest.d.ts +10 -0
  192. package/dist/types/item/hosting.d.ts +20 -0
  193. package/dist/types/item/props.d.ts +35 -0
  194. package/dist/types/item/query.d.ts +14 -0
  195. package/dist/types/item/sampling.d.ts +5 -0
  196. package/dist/types/item/transform.d.ts +3 -0
  197. package/dist/types/net/http.d.ts +6 -0
  198. package/dist/types/node/CanvasAdapter.d.ts +19 -0
  199. package/dist/types/node/index.d.ts +60 -0
  200. package/dist/types/node/peers.d.ts +2 -0
  201. package/dist/types/offset/curves.d.ts +22 -0
  202. package/dist/types/offset/index.d.ts +65 -0
  203. package/dist/types/offset/offset.d.ts +18 -0
  204. package/dist/types/offset/outline.d.ts +14 -0
  205. package/dist/types/offset/pen.d.ts +36 -0
  206. package/dist/types/offset/profile.d.ts +37 -0
  207. package/dist/types/offset/round.d.ts +18 -0
  208. package/dist/types/offset/sweep.d.ts +44 -0
  209. package/dist/types/paperscript/PaperScript.d.ts +114 -0
  210. package/dist/types/paperscript/autoload.d.ts +1 -0
  211. package/dist/types/paperscript/index.d.ts +7 -0
  212. package/dist/types/path/CompoundPath.d.ts +183 -0
  213. package/dist/types/path/Curve.d.ts +567 -0
  214. package/dist/types/path/CurveLocation.d.ts +164 -0
  215. package/dist/types/path/Path.d.ts +1361 -0
  216. package/dist/types/path/PathFlattener.d.ts +48 -0
  217. package/dist/types/path/PathItem.d.ts +1190 -0
  218. package/dist/types/path/Segment.d.ts +335 -0
  219. package/dist/types/path/SegmentPoint.d.ts +1 -0
  220. package/dist/types/path/StrokeProfile.d.ts +74 -0
  221. package/dist/types/path/StrokeProfileStop.d.ts +110 -0
  222. package/dist/types/path/boolean.d.ts +24 -0
  223. package/dist/types/path/bounds.d.ts +24 -0
  224. package/dist/types/path/crossing.d.ts +2 -0
  225. package/dist/types/path/draw.d.ts +6 -0
  226. package/dist/types/path/hitTest.d.ts +8 -0
  227. package/dist/types/path/offset.d.ts +14 -0
  228. package/dist/types/path/shapes.d.ts +20 -0
  229. package/dist/types/path/smooth.d.ts +18 -0
  230. package/dist/types/path/values.d.ts +8 -0
  231. package/dist/types/scope/PaperScope.d.ts +182 -0
  232. package/dist/types/scope/PaperScopeItem.d.ts +26 -0
  233. package/dist/types/smoothing/index.d.ts +26 -0
  234. package/dist/types/style/Color.d.ts +829 -0
  235. package/dist/types/style/Gradient.d.ts +130 -0
  236. package/dist/types/style/GradientStop.d.ts +126 -0
  237. package/dist/types/style/PatternDefinition.d.ts +185 -0
  238. package/dist/types/style/Style.d.ts +757 -0
  239. package/dist/types/svg/index.d.ts +14 -0
  240. package/dist/types/svg/svgElement.d.ts +32 -0
  241. package/dist/types/svg/svgExport.d.ts +19 -0
  242. package/dist/types/svg/svgImport.d.ts +13 -0
  243. package/dist/types/svg/svgStyles.d.ts +20 -0
  244. package/dist/types/text/AreaText.d.ts +104 -0
  245. package/dist/types/text/PathText.d.ts +78 -0
  246. package/dist/types/text/PointText.d.ts +50 -0
  247. package/dist/types/text/TextItem.d.ts +163 -0
  248. package/dist/types/text/TextRange.d.ts +98 -0
  249. package/dist/types/text/TextStory.d.ts +119 -0
  250. package/dist/types/text/areaLayout.d.ts +3 -0
  251. package/dist/types/text/layout.d.ts +43 -0
  252. package/dist/types/text/measure.d.ts +7 -0
  253. package/dist/types/text/pathLayout.d.ts +3 -0
  254. package/dist/types/tool/Tool.d.ts +356 -0
  255. package/dist/types/tool/ToolEvent.d.ts +134 -0
  256. package/dist/types/util/Formatter.d.ts +34 -0
  257. package/dist/types/util/collisions.d.ts +77 -0
  258. package/dist/types/util/list.d.ts +23 -0
  259. package/dist/types/util/numerical.d.ts +196 -0
  260. package/dist/types/util/object.d.ts +19 -0
  261. package/dist/types/util/string.d.ts +12 -0
  262. package/dist/types/util/uid.d.ts +7 -0
  263. package/dist/types/values/arcs.d.ts +10 -0
  264. package/dist/types/values/curve.d.ts +42 -0
  265. package/dist/types/values/fit.d.ts +26 -0
  266. package/dist/types/values/index.d.ts +10 -0
  267. package/dist/types/values/intersections.d.ts +11 -0
  268. package/dist/types/values/matrix.d.ts +19 -0
  269. package/dist/types/values/path.d.ts +26 -0
  270. package/dist/types/values/profile.d.ts +41 -0
  271. package/dist/types/values/region.d.ts +13 -0
  272. package/dist/types/values/smooth.d.ts +39 -0
  273. package/dist/types/values/svg.d.ts +47 -0
  274. package/dist/types/view/CanvasView.d.ts +37 -0
  275. package/dist/types/view/View.d.ts +700 -0
  276. package/dist/types/view/input.d.ts +28 -0
  277. package/package.json +90 -58
  278. package/dist/docs/assets/css/docs.css +0 -414
  279. package/dist/docs/assets/js/codemirror.js +0 -4
  280. package/dist/docs/assets/js/docs.js +0 -493
  281. package/dist/docs/assets/js/jquery.js +0 -6
  282. package/dist/docs/assets/js/paper.js +0 -23759
  283. package/dist/docs/classes/AreaText.html +0 -8708
  284. package/dist/docs/classes/ChangeFlag.html +0 -385
  285. package/dist/docs/classes/Color.html +0 -2205
  286. package/dist/docs/classes/CompoundPath.html +0 -9168
  287. package/dist/docs/classes/Curve.html +0 -2326
  288. package/dist/docs/classes/CurveLocation.html +0 -673
  289. package/dist/docs/classes/Event.html +0 -177
  290. package/dist/docs/classes/Gradient.html +0 -241
  291. package/dist/docs/classes/GradientStop.html +0 -274
  292. package/dist/docs/classes/Group.html +0 -7139
  293. package/dist/docs/classes/HitResult.html +0 -241
  294. package/dist/docs/classes/HostItem.html +0 -6836
  295. package/dist/docs/classes/Item.html +0 -6892
  296. package/dist/docs/classes/Key.html +0 -140
  297. package/dist/docs/classes/KeyEvent.html +0 -309
  298. package/dist/docs/classes/Layer.html +0 -7122
  299. package/dist/docs/classes/Matrix.html +0 -1745
  300. package/dist/docs/classes/MouseEvent.html +0 -356
  301. package/dist/docs/classes/PaperScope.html +0 -548
  302. package/dist/docs/classes/PaperScript.html +0 -202
  303. package/dist/docs/classes/Path.html +0 -12064
  304. package/dist/docs/classes/PathItem.html +0 -8930
  305. package/dist/docs/classes/PathText.html +0 -8578
  306. package/dist/docs/classes/Point.html +0 -2860
  307. package/dist/docs/classes/PointText.html +0 -8489
  308. package/dist/docs/classes/Project.html +0 -1604
  309. package/dist/docs/classes/Raster.html +0 -8069
  310. package/dist/docs/classes/Rectangle.html +0 -1698
  311. package/dist/docs/classes/Segment.html +0 -1017
  312. package/dist/docs/classes/Shape.html +0 -7570
  313. package/dist/docs/classes/Size.html +0 -1915
  314. package/dist/docs/classes/Style.html +0 -1765
  315. package/dist/docs/classes/SymbolDefinition.html +0 -312
  316. package/dist/docs/classes/SymbolItem.html +0 -6999
  317. package/dist/docs/classes/TextItem.html +0 -8332
  318. package/dist/docs/classes/TextRange.html +0 -186
  319. package/dist/docs/classes/TextStory.html +0 -355
  320. package/dist/docs/classes/Tool.html +0 -888
  321. package/dist/docs/classes/ToolEvent.html +0 -525
  322. package/dist/docs/classes/Tween.html +0 -390
  323. package/dist/docs/classes/View.html +0 -2108
  324. package/dist/docs/classes/global.html +0 -426
  325. package/dist/docs/classes/index.html +0 -88
  326. package/dist/docs/index.html +0 -11
  327. package/dist/node/canvas.js +0 -68
  328. package/dist/node/extend.js +0 -156
  329. package/dist/node/self.js +0 -67
  330. package/dist/paper-core.d.ts +0 -1
  331. package/dist/paper-core.js +0 -21834
  332. package/dist/paper-core.min.js +0 -32
  333. package/dist/paper.d.ts +0 -9630
  334. package/examples/Animated/AnimatedStar.html +0 -53
  335. package/examples/Animated/BooleanOperations.html +0 -115
  336. package/examples/Animated/CandyCrash.html +0 -151
  337. package/examples/Animated/Extruded.html +0 -50
  338. package/examples/Animated/Lines.html +0 -53
  339. package/examples/Animated/Smoothing.html +0 -70
  340. package/examples/Animated/Space.html +0 -86
  341. package/examples/Animated/SpaceUsingShapes.html +0 -79
  342. package/examples/Games/Paperoids.html +0 -569
  343. package/examples/JSON/Circle Testing.html +0 -34
  344. package/examples/JSON/Compound Path.html +0 -25
  345. package/examples/JSON/Empty Path Testing.html +0 -31
  346. package/examples/JSON/Gradients.html +0 -34
  347. package/examples/JSON/Group Transform.html +0 -28
  348. package/examples/JSON/Line Testing.html +0 -44
  349. package/examples/JSON/Random Path Testing.html +0 -42
  350. package/examples/JSON/Raster.html +0 -29
  351. package/examples/JSON/Rect and Attribute Testing.html +0 -56
  352. package/examples/JSON/Rotated Primitives.html +0 -55
  353. package/examples/JSON/Selection.html +0 -43
  354. package/examples/JSON/Shapes.html +0 -54
  355. package/examples/JSON/Symbols.html +0 -30
  356. package/examples/JSON/Text Testing.html +0 -38
  357. package/examples/JSON/Tiger.html +0 -19
  358. package/examples/JSON/Transform Test 1.html +0 -32
  359. package/examples/JSON/Transform Test 2.html +0 -30
  360. package/examples/Node.js/AnimatedStar.js +0 -52
  361. package/examples/Node.js/BooleanOperations.js +0 -36
  362. package/examples/Node.js/JSONtoPDF.js +0 -20
  363. package/examples/Node.js/Raster.js +0 -32
  364. package/examples/Node.js/RasterRemote.js +0 -33
  365. package/examples/Node.js/SvgExport.js +0 -52
  366. package/examples/Node.js/SvgImport.js +0 -23
  367. package/examples/Node.js/Tadpoles.js +0 -16
  368. package/examples/Node.js/Tadpoles.pjs +0 -278
  369. package/examples/Node.js/in.json +0 -1
  370. package/examples/Node.js/in.svg +0 -16
  371. package/examples/Paperjs.org/BooleanOperattions.html +0 -115
  372. package/examples/Paperjs.org/BouncingBalls.html +0 -103
  373. package/examples/Paperjs.org/Chain.html +0 -54
  374. package/examples/Paperjs.org/DivisionRaster.html +0 -72
  375. package/examples/Paperjs.org/FutureSplash.html +0 -122
  376. package/examples/Paperjs.org/HitTesting.html +0 -103
  377. package/examples/Paperjs.org/InteractiveTiger.html +0 -777
  378. package/examples/Paperjs.org/MetaBalls.html +0 -132
  379. package/examples/Paperjs.org/NyanRainbow.html +0 -202
  380. package/examples/Paperjs.org/PathIntersections.html +0 -76
  381. package/examples/Paperjs.org/Qbertify.html +0 -146
  382. package/examples/Paperjs.org/RadialRainbows.html +0 -80
  383. package/examples/Paperjs.org/RoundedRectangles.html +0 -41
  384. package/examples/Paperjs.org/SatieLikedToDraw.html +0 -140
  385. package/examples/Paperjs.org/Simplify.html +0 -63
  386. package/examples/Paperjs.org/SpiralRaster.html +0 -120
  387. package/examples/Paperjs.org/Tadpoles.html +0 -283
  388. package/examples/Paperjs.org/Voronoi.html +0 -134
  389. package/examples/Rasters/PhyllotaxisRaster.html +0 -96
  390. package/examples/Rasters/Raster.html +0 -34
  391. package/examples/Rasters/RotationRaster.html +0 -44
  392. package/examples/Rasters/Smoothing.html +0 -36
  393. package/examples/SVG Export/Circle Testing.html +0 -32
  394. package/examples/SVG Export/Clipping.html +0 -17
  395. package/examples/SVG Export/Compound Path.html +0 -22
  396. package/examples/SVG Export/Empty Path Testing.html +0 -28
  397. package/examples/SVG Export/Gradients.html +0 -52
  398. package/examples/SVG Export/Group Transform.html +0 -25
  399. package/examples/SVG Export/Line Testing.html +0 -41
  400. package/examples/SVG Export/Random Path Testing.html +0 -39
  401. package/examples/SVG Export/Raster.html +0 -21
  402. package/examples/SVG Export/Rect and Attribute Testing.html +0 -53
  403. package/examples/SVG Export/Rotated Primitives.html +0 -80
  404. package/examples/SVG Export/Shapes.html +0 -58
  405. package/examples/SVG Export/Symbols.html +0 -27
  406. package/examples/SVG Export/Text Testing.html +0 -45
  407. package/examples/SVG Export/Tiger.html +0 -23
  408. package/examples/SVG Export/Transform Test 1.html +0 -29
  409. package/examples/SVG Export/Transform Test 2.html +0 -27
  410. package/examples/SVG Import/Arcs.html +0 -78
  411. package/examples/SVG Import/Butterfly.html +0 -223
  412. package/examples/SVG Import/Circle and Ellipse Testing.html +0 -26
  413. package/examples/SVG Import/Clipping.html +0 -100
  414. package/examples/SVG Import/From File.html +0 -30
  415. package/examples/SVG Import/Gradient.html +0 -138
  416. package/examples/SVG Import/Gradients.html +0 -30
  417. package/examples/SVG Import/Inkscape Pivot.html +0 -52
  418. package/examples/SVG Import/Inkscape.html +0 -88
  419. package/examples/SVG Import/Line Testing.html +0 -24
  420. package/examples/SVG Import/MoreGradients.html +0 -107
  421. package/examples/SVG Import/Multiple Paths Test 1.html +0 -42
  422. package/examples/SVG Import/Multiple Paths Test 2.html +0 -33
  423. package/examples/SVG Import/Nested Groups Test.html +0 -78
  424. package/examples/SVG Import/Polybezier.html +0 -43
  425. package/examples/SVG Import/Rect Testing.html +0 -25
  426. package/examples/SVG Import/Symbols.html +0 -24
  427. package/examples/SVG Import/Testing.html +0 -40
  428. package/examples/SVG Import/Text Testing.html +0 -19
  429. package/examples/SVG Import/Tiger.html +0 -742
  430. package/examples/SVG Import/Transform Testing.html +0 -22
  431. package/examples/SVG Import/Viewbox.html +0 -38
  432. package/examples/Scripts/Arcs.html +0 -39
  433. package/examples/Scripts/AreaText.html +0 -65
  434. package/examples/Scripts/BlendModes.html +0 -77
  435. package/examples/Scripts/BooleanOperations.html +0 -937
  436. package/examples/Scripts/CompoundPath.html +0 -19
  437. package/examples/Scripts/CurveTimeParameterization.html +0 -61
  438. package/examples/Scripts/HslColor.html +0 -53
  439. package/examples/Scripts/PathStructure.html +0 -82
  440. package/examples/Scripts/PathTangents.html +0 -73
  441. package/examples/Scripts/PathText.html +0 -48
  442. package/examples/Scripts/Resize.html +0 -42
  443. package/examples/Scripts/RoundRectangle.html +0 -28
  444. package/examples/Scripts/Shapes.html +0 -54
  445. package/examples/Scripts/StrokeBounds.html +0 -101
  446. package/examples/Scripts/StrokeScaling.html +0 -65
  447. package/examples/Scripts/TextRanges.html +0 -51
  448. package/examples/Tools/BezierTool.html +0 -90
  449. package/examples/Tools/Circles.html +0 -28
  450. package/examples/Tools/Clouds.html +0 -35
  451. package/examples/Tools/DrippingBrush.html +0 -73
  452. package/examples/Tools/FancyBrush.html +0 -82
  453. package/examples/Tools/Grid.html +0 -44
  454. package/examples/Tools/MultiLines.html +0 -44
  455. package/examples/Tools/MultipleTools.html +0 -44
  456. package/examples/Tools/PathEditing.html +0 -95
  457. package/examples/Tools/SquareRounded.html +0 -76
  458. package/examples/Tools/Stars.html +0 -38
  459. package/examples/Tools/Vektor.html +0 -200
  460. package/examples/Tools/Wave.html +0 -50
  461. package/examples/Tools/WormFarm.html +0 -88
  462. package/examples/Worker/Main.html +0 -53
  463. package/examples/Worker/Worker.js +0 -14
  464. package/examples/css/style.css +0 -12
@@ -1,888 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Tool</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>Tool</h1>
17
-
18
- <p>The Tool object refers to a script that the user can interact with by using the mouse and keyboard and can be accessed through the global <code>tool</code> variable. All its properties are also available in the paper scope.</p>
19
- <p>The global <code>tool</code> variable only exists in scripts that contain mouse handler functions (<a href="../classes/Tool.html#onmousemove"><tt>onMouseMove</tt></a>, <a href="../classes/Tool.html#onmousedown"><tt>onMouseDown</tt></a>, <a href="../classes/Tool.html#onmousedrag"><tt>onMouseDrag</tt></a>, <a href="../classes/Tool.html#onmouseup"><tt>onMouseUp</tt></a>) or a keyboard handler function (<a href="../classes/Tool.html#onkeydown"><tt>onKeyDown</tt></a>, <a href="../classes/Tool.html#onkeyup"><tt>onKeyUp</tt></a>).</p>
20
- <h4>Example:</h4>
21
-
22
- <div class="paperscript split">
23
-
24
- <div class="buttons">
25
- <div class="button run">Run</div>
26
- </div>
27
-
28
- <script type="text/paperscript" canvas="canvas-0">
29
- var path;
30
-
31
- // Only execute onMouseDrag when the mouse
32
- // has moved at least 10 points:
33
- tool.minDistance = 10;
34
-
35
- tool.onMouseDown = function(event) {
36
- // Create a new path every time the mouse is clicked
37
- path = new Path();
38
- path.add(event.point);
39
- path.strokeColor = 'black';
40
- }
41
-
42
- tool.onMouseDrag = function(event) {
43
- // Add a point to the path every time the mouse is dragged
44
- path.add(event.point);
45
- }
46
- </script>
47
- <div class="canvas"><canvas width="516" height="300" id="canvas-0"></canvas></div>
48
- </div>
49
-
50
-
51
-
52
- </div>
53
-
54
-
55
-
56
-
57
-
58
- <!-- ================================ properties =========================== -->
59
- <div class="reference-members">
60
- <h2>Properties</h2>
61
-
62
-
63
- <div id="scope" class="member">
64
- <div class="member-link">
65
- <a name="scope" href="#scope"><tt><b>scope</b></tt></a>
66
- </div>
67
- <div class="member-description hidden">
68
-
69
- <div class="member-text">
70
- <p>The scope that this tool belongs to.</p>
71
-
72
- <p>Read only.</p>
73
-
74
-
75
-
76
- <ul class="member-list">
77
- <h4>Type:</h4>
78
- <li>
79
- <a href="../classes/PaperScope.html"><tt>PaperScope</tt></a>
80
- </li>
81
- </ul>
82
-
83
-
84
-
85
- </div>
86
-
87
- </div>
88
- </div>
89
-
90
-
91
- <div id="mindistance" class="member">
92
- <div class="member-link">
93
- <a name="mindistance" href="#mindistance"><tt><b>minDistance</b></tt></a>
94
- </div>
95
- <div class="member-description hidden">
96
-
97
- <div class="member-text">
98
- <p>The minimum distance the mouse has to drag before firing the onMouseDrag event, since the last onMouseDrag event.</p>
99
-
100
-
101
-
102
- <ul class="member-list">
103
- <h4>Type:</h4>
104
- <li>
105
- <tt>Number</tt>
106
- </li>
107
- </ul>
108
-
109
-
110
-
111
- </div>
112
-
113
- </div>
114
- </div>
115
-
116
-
117
- <div id="maxdistance" class="member">
118
- <div class="member-link">
119
- <a name="maxdistance" href="#maxdistance"><tt><b>maxDistance</b></tt></a>
120
- </div>
121
- <div class="member-description hidden">
122
-
123
- <div class="member-text">
124
- <p>The maximum distance the mouse has to drag before firing the onMouseDrag event, since the last onMouseDrag event.</p>
125
-
126
-
127
-
128
- <ul class="member-list">
129
- <h4>Type:</h4>
130
- <li>
131
- <tt>Number</tt>
132
- </li>
133
- </ul>
134
-
135
-
136
-
137
- </div>
138
-
139
- </div>
140
- </div>
141
-
142
-
143
- <div id="eventinterval" class="member">
144
- <div class="member-link">
145
- <a name="eventinterval" href="#eventinterval"><tt><b>eventInterval</b></tt></a>
146
- </div>
147
- <div class="member-description hidden">
148
-
149
- <div class="member-text">
150
- <p>The interval in milliseconds at which the onMouseDrag event fires again while the mouse button is held, also when the mouse doesn&rsquo;t move. The repeated events are at the last point, with a zero <a href="../classes/ToolEvent.html#delta"><tt>toolEvent.delta</tt></a>. <code>null</code>, the default, or anything up to 0 turns it off.</p>
151
-
152
-
153
-
154
- <ul class="member-list">
155
- <h4>Default:</h4>
156
- <li><tt>null</tt></li>
157
- </ul>
158
-
159
- <ul class="member-list">
160
- <h4>Type:</h4>
161
- <li>
162
- <tt>Number</tt>
163
- </li>
164
- </ul>
165
-
166
-
167
- <h4>Example:<span class="description">Fire the onMouseDrag event 10 times a second, while the mouse button is held:</span></h4>
168
-
169
-
170
- <pre><code>tool.eventInterval = 100;</code></pre>
171
-
172
- </div>
173
-
174
- </div>
175
- </div>
176
-
177
-
178
- <div id="fixeddistance" class="member">
179
- <div class="member-link">
180
- <a name="fixeddistance" href="#fixeddistance"><tt><b>fixedDistance</b></tt></a>
181
- </div>
182
- <div class="member-description hidden">
183
-
184
- <div class="member-text">
185
-
186
-
187
-
188
-
189
- <ul class="member-list">
190
- <h4>Type:</h4>
191
- <li>
192
- <tt>Number</tt>
193
- </li>
194
- </ul>
195
-
196
-
197
-
198
- </div>
199
-
200
- </div>
201
- </div>
202
-
203
-
204
- <h3>Mouse Event Handlers</h3>
205
-
206
- <div id="onmousedown" class="member">
207
- <div class="member-link">
208
- <a name="onmousedown" href="#onmousedown"><tt><b>onMouseDown</b></tt></a>
209
- </div>
210
- <div class="member-description hidden">
211
-
212
- <div class="member-text">
213
- <p>The function to be called when the mouse button is pushed down. The function receives a <a href="../classes/ToolEvent.html"><tt>ToolEvent</tt></a> object which contains information about the tool event.</p>
214
-
215
-
216
-
217
- <ul class="member-list">
218
- <h4>Type:</h4>
219
- <li>
220
- <tt>Function</tt>⟋<tt>null</tt>
221
- </li>
222
- </ul>
223
-
224
-
225
- <h4>Example:<span class="description">Creating circle shaped paths where the user presses the mouse button:</span></h4>
226
-
227
- <div class="paperscript split">
228
-
229
- <div class="buttons">
230
- <div class="button run">Run</div>
231
- </div>
232
-
233
- <script type="text/paperscript" canvas="canvas-1">
234
- tool.onMouseDown = function(event) {
235
- // Create a new circle shaped path with a radius of 10
236
- // at the position of the mouse (event.point):
237
- var path = new Path.Circle({
238
- center: event.point,
239
- radius: 10,
240
- fillColor: 'black'
241
- });
242
- }
243
- </script>
244
- <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
245
- </div>
246
-
247
-
248
- </div>
249
-
250
- </div>
251
- </div>
252
-
253
-
254
- <div id="onmousedrag" class="member">
255
- <div class="member-link">
256
- <a name="onmousedrag" href="#onmousedrag"><tt><b>onMouseDrag</b></tt></a>
257
- </div>
258
- <div class="member-description hidden">
259
-
260
- <div class="member-text">
261
- <p>The function to be called when the mouse position changes while the mouse is being dragged. The function receives a <a href="../classes/ToolEvent.html"><tt>ToolEvent</tt></a> object which contains information about the tool event.</p>
262
-
263
-
264
-
265
- <ul class="member-list">
266
- <h4>Type:</h4>
267
- <li>
268
- <tt>Function</tt>⟋<tt>null</tt>
269
- </li>
270
- </ul>
271
-
272
-
273
- <h4>Example:<span class="description">Draw a line by adding a segment to a path on every mouse drag event:</span></h4>
274
-
275
- <div class="paperscript split">
276
-
277
- <div class="buttons">
278
- <div class="button run">Run</div>
279
- </div>
280
-
281
- <script type="text/paperscript" canvas="canvas-2">
282
- // Create an empty path:
283
- var path = new Path({
284
- strokeColor: 'black'
285
- });
286
-
287
- tool.onMouseDrag = function(event) {
288
- // Add a segment to the path at the position of the mouse:
289
- path.add(event.point);
290
- }
291
- </script>
292
- <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
293
- </div>
294
-
295
-
296
- </div>
297
-
298
- </div>
299
- </div>
300
-
301
-
302
- <div id="onmousemove" class="member">
303
- <div class="member-link">
304
- <a name="onmousemove" href="#onmousemove"><tt><b>onMouseMove</b></tt></a>
305
- </div>
306
- <div class="member-description hidden">
307
-
308
- <div class="member-text">
309
- <p>The function to be called the mouse moves within the project view. The function receives a <a href="../classes/ToolEvent.html"><tt>ToolEvent</tt></a> object which contains information about the tool event.</p>
310
- <p>While the mouse button is held down, the tool calls <a href="../classes/Tool.html#onmousedrag"><tt>onMouseDrag</tt></a> instead, if it defines one, and <code>onMouseMove</code> only otherwise.</p>
311
-
312
-
313
-
314
- <ul class="member-list">
315
- <h4>Type:</h4>
316
- <li>
317
- <tt>Function</tt>⟋<tt>null</tt>
318
- </li>
319
- </ul>
320
-
321
-
322
- <h4>Example:<span class="description">Moving a path to the position of the mouse:</span></h4>
323
-
324
- <div class="paperscript split">
325
-
326
- <div class="buttons">
327
- <div class="button run">Run</div>
328
- </div>
329
-
330
- <script type="text/paperscript" canvas="canvas-3">
331
- // Create a circle shaped path with a radius of 10 at {x: 0, y: 0}:
332
- var path = new Path.Circle({
333
- center: [0, 0],
334
- radius: 10,
335
- fillColor: 'black'
336
- });
337
-
338
- tool.onMouseMove = function(event) {
339
- // Whenever the user moves the mouse, move the path
340
- // to that position:
341
- path.position = event.point;
342
- }
343
- </script>
344
- <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
345
- </div>
346
-
347
-
348
- </div>
349
-
350
- </div>
351
- </div>
352
-
353
-
354
- <div id="onmouseup" class="member">
355
- <div class="member-link">
356
- <a name="onmouseup" href="#onmouseup"><tt><b>onMouseUp</b></tt></a>
357
- </div>
358
- <div class="member-description hidden">
359
-
360
- <div class="member-text">
361
- <p>The function to be called when the mouse button is released. The function receives a <a href="../classes/ToolEvent.html"><tt>ToolEvent</tt></a> object which contains information about the tool event.</p>
362
-
363
-
364
-
365
- <ul class="member-list">
366
- <h4>Type:</h4>
367
- <li>
368
- <tt>Function</tt>⟋<tt>null</tt>
369
- </li>
370
- </ul>
371
-
372
-
373
- <h4>Example:<span class="description">Creating circle shaped paths where the user releases the mouse:</span></h4>
374
-
375
- <div class="paperscript split">
376
-
377
- <div class="buttons">
378
- <div class="button run">Run</div>
379
- </div>
380
-
381
- <script type="text/paperscript" canvas="canvas-4">
382
- tool.onMouseUp = function(event) {
383
- // Create a new circle shaped path with a radius of 10
384
- // at the position of the mouse (event.point):
385
- var path = new Path.Circle({
386
- center: event.point,
387
- radius: 10,
388
- fillColor: 'black'
389
- });
390
- }
391
- </script>
392
- <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
393
- </div>
394
-
395
-
396
- </div>
397
-
398
- </div>
399
- </div>
400
-
401
-
402
- <h3>Keyboard Event Handlers</h3>
403
-
404
- <div id="onkeydown" class="member">
405
- <div class="member-link">
406
- <a name="onkeydown" href="#onkeydown"><tt><b>onKeyDown</b></tt></a>
407
- </div>
408
- <div class="member-description hidden">
409
-
410
- <div class="member-text">
411
- <p>The function to be called when the user presses a key on the keyboard. The function receives a <a href="../classes/KeyEvent.html"><tt>KeyEvent</tt></a> object which contains information about the keyboard event.</p>
412
- <p>If the function returns <code>false</code>, the keyboard event will be prevented from bubbling up. This can be used for example to stop the window from scrolling, when you need the user to interact with arrow keys.</p>
413
-
414
-
415
-
416
- <ul class="member-list">
417
- <h4>Type:</h4>
418
- <li>
419
- <tt>Function</tt>⟋<tt>null</tt>
420
- </li>
421
- </ul>
422
-
423
-
424
- <h4>Example:<span class="description">Scaling a path whenever the user presses the space bar:</span></h4>
425
-
426
- <div class="paperscript split">
427
-
428
- <div class="buttons">
429
- <div class="button run">Run</div>
430
- </div>
431
-
432
- <script type="text/paperscript" canvas="canvas-5">
433
- // Create a circle shaped path:
434
- var path = new Path.Circle({
435
- center: new Point(50, 50),
436
- radius: 30,
437
- fillColor: 'red'
438
- });
439
-
440
- tool.onKeyDown = function(event) {
441
- if (event.key == 'space') {
442
- // Scale the path by 110%:
443
- path.scale(1.1);
444
-
445
- // Prevent the key event from bubbling
446
- return false;
447
- }
448
- }
449
- </script>
450
- <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
451
- </div>
452
-
453
-
454
- </div>
455
-
456
- </div>
457
- </div>
458
-
459
-
460
- <div id="onkeyup" class="member">
461
- <div class="member-link">
462
- <a name="onkeyup" href="#onkeyup"><tt><b>onKeyUp</b></tt></a>
463
- </div>
464
- <div class="member-description hidden">
465
-
466
- <div class="member-text">
467
- <p>The function to be called when the user releases a key on the keyboard. The function receives a <a href="../classes/KeyEvent.html"><tt>KeyEvent</tt></a> object which contains information about the keyboard event.</p>
468
- <p>If the function returns <code>false</code>, the keyboard event will be prevented from bubbling up. This can be used for example to stop the window from scrolling, when you need the user to interact with arrow keys.</p>
469
-
470
-
471
-
472
- <ul class="member-list">
473
- <h4>Type:</h4>
474
- <li>
475
- <tt>Function</tt>⟋<tt>null</tt>
476
- </li>
477
- </ul>
478
-
479
-
480
- <h4>Example:</h4>
481
-
482
-
483
- <pre><code>tool.onKeyUp = function(event) {
484
- if (event.key == 'space') {
485
- console.log('The spacebar was released!');
486
- }
487
- }</code></pre>
488
-
489
- </div>
490
-
491
- </div>
492
- </div>
493
-
494
-
495
- <h3>Activation Event Handlers</h3>
496
-
497
- <div id="onactivate" class="member">
498
- <div class="member-link">
499
- <a name="onactivate" href="#onactivate"><tt><b>onActivate</b></tt></a>
500
- </div>
501
- <div class="member-description hidden">
502
-
503
- <div class="member-text">
504
- <p>The function to be called when the tool is activated through <a href="../classes/Tool.html#activate"><tt>activate</tt></a>(). The function receives the previously active tool, which is the tool itself when it was already active.</p>
505
-
506
-
507
-
508
- <ul class="member-list">
509
- <h4>Type:</h4>
510
- <li>
511
- <tt>Function</tt>⟋<tt>null</tt>
512
- </li>
513
- </ul>
514
-
515
-
516
- <h4>Example:</h4>
517
-
518
-
519
- <pre><code>tool.onActivate = function(previous) {
520
- if (previous == tool) {
521
- console.log('The tool was activated again!');
522
- }
523
- }</code></pre>
524
-
525
- </div>
526
-
527
- </div>
528
- </div>
529
-
530
-
531
- <div id="ondeactivate" class="member">
532
- <div class="member-link">
533
- <a name="ondeactivate" href="#ondeactivate"><tt><b>onDeactivate</b></tt></a>
534
- </div>
535
- <div class="member-description hidden">
536
-
537
- <div class="member-text">
538
- <p>The function to be called when another tool is activated through <a href="../classes/Tool.html#activate"><tt>activate</tt></a>(), while this one is active.</p>
539
-
540
-
541
-
542
- <ul class="member-list">
543
- <h4>Type:</h4>
544
- <li>
545
- <tt>Function</tt>⟋<tt>null</tt>
546
- </li>
547
- </ul>
548
-
549
-
550
-
551
- </div>
552
-
553
- </div>
554
- </div>
555
-
556
- </div>
557
-
558
-
559
-
560
-
561
-
562
- <!-- ============================== methods ================================ -->
563
- <div class="reference-members">
564
- <h2>Methods</h2>
565
-
566
-
567
- <div id="activate" class="member">
568
- <div class="member-link">
569
- <a name="activate" href="#activate"><tt><b>activate</b>()</tt></a>
570
- </div>
571
- <div class="member-description hidden">
572
- <div class="member-text">
573
- <p>Activates this tool, meaning <a href="../classes/PaperScope.html#tool"><tt>paperScope.tool</tt></a> will point to it and it will be the one that receives tool events.</p>
574
-
575
-
576
-
577
-
578
-
579
-
580
-
581
- </div>
582
- </div>
583
- </div>
584
-
585
-
586
- <div id="remove" class="member">
587
- <div class="member-link">
588
- <a name="remove" href="#remove"><tt><b>remove</b>()</tt></a>
589
- </div>
590
- <div class="member-description hidden">
591
- <div class="member-text">
592
- <p>Removes this tool from the <a href="../classes/PaperScope.html#tools"><tt>paperScope.tools</tt></a> list.</p>
593
-
594
-
595
-
596
-
597
-
598
-
599
-
600
- </div>
601
- </div>
602
- </div>
603
-
604
-
605
- <h3>Event Handling</h3>
606
-
607
- <div id="on-type-function" class="member">
608
- <div class="member-link">
609
- <a name="on-type-function" href="#on-type-function"><tt><b>on</b>(type, function)</tt></a>
610
- </div>
611
- <div class="member-description hidden">
612
- <div class="member-text">
613
- <p>Attach an event handler to the tool.</p>
614
-
615
-
616
- <ul class="member-list">
617
- <h4>Parameters:</h4>
618
-
619
- <li>
620
- <tt>type:</tt>
621
- <tt>String</tt>
622
- &mdash;&nbsp;the event type: <tt>&lsquo;mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;keydown&rsquo;</tt>, <tt>&lsquo;keyup&rsquo;</tt>
623
-
624
- </li>
625
-
626
- <li>
627
- <tt>function:</tt>
628
- <tt>Function</tt>
629
- &mdash;&nbsp;the function to be called when the event occurs, receiving a <a href="../classes/ToolEvent.html"><tt>ToolEvent</tt></a> object as its sole argument
630
-
631
- </li>
632
-
633
- </ul>
634
-
635
-
636
- <ul class="member-list">
637
- <h4>Returns:</h4>
638
-
639
- <li>
640
- <tt><a href="../classes/Tool.html"><tt>Tool</tt></a></tt>&nbsp;&mdash;&nbsp;this tool itself, so calls can be chained
641
- </li>
642
-
643
-
644
- </ul>
645
-
646
-
647
-
648
-
649
-
650
- </div>
651
- </div>
652
- </div>
653
-
654
-
655
- <div id="on-param" class="member">
656
- <div class="member-link">
657
- <a name="on-param" href="#on-param"><tt><b>on</b>(param)</tt></a>
658
- </div>
659
- <div class="member-description hidden">
660
- <div class="member-text">
661
- <p>Attach one or more event handlers to the tool.</p>
662
-
663
-
664
- <ul class="member-list">
665
- <h4>Parameters:</h4>
666
-
667
- <li>
668
- <tt>param:</tt>
669
- <tt>Object</tt>
670
- &mdash;&nbsp;an object literal containing one or more of the following properties: <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>mousemove</tt>, <tt>keydown</tt>, <tt>keyup</tt>
671
-
672
- </li>
673
-
674
- </ul>
675
-
676
-
677
- <ul class="member-list">
678
- <h4>Returns:</h4>
679
-
680
- <li>
681
- <tt><a href="../classes/Tool.html"><tt>Tool</tt></a></tt>&nbsp;&mdash;&nbsp;this tool itself, so calls can be chained
682
- </li>
683
-
684
-
685
- </ul>
686
-
687
-
688
-
689
-
690
-
691
- </div>
692
- </div>
693
- </div>
694
-
695
-
696
- <div id="off-type-function" class="member">
697
- <div class="member-link">
698
- <a name="off-type-function" href="#off-type-function"><tt><b>off</b>(type, function)</tt></a>
699
- </div>
700
- <div class="member-description hidden">
701
- <div class="member-text">
702
- <p>Detach an event handler from the tool.</p>
703
-
704
-
705
- <ul class="member-list">
706
- <h4>Parameters:</h4>
707
-
708
- <li>
709
- <tt>type:</tt>
710
- <tt>String</tt>
711
- &mdash;&nbsp;the event type: <tt>&lsquo;mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;keydown&rsquo;</tt>, <tt>&lsquo;keyup&rsquo;</tt>
712
-
713
- </li>
714
-
715
- <li>
716
- <tt>function:</tt>
717
- <tt>Function</tt>
718
- &mdash;&nbsp;the function to be detached
719
-
720
- </li>
721
-
722
- </ul>
723
-
724
-
725
- <ul class="member-list">
726
- <h4>Returns:</h4>
727
-
728
- <li>
729
- <tt><a href="../classes/Tool.html"><tt>Tool</tt></a></tt>&nbsp;&mdash;&nbsp;this tool itself, so calls can be chained
730
- </li>
731
-
732
-
733
- </ul>
734
-
735
-
736
-
737
-
738
-
739
- </div>
740
- </div>
741
- </div>
742
-
743
-
744
- <div id="off-param" class="member">
745
- <div class="member-link">
746
- <a name="off-param" href="#off-param"><tt><b>off</b>(param)</tt></a>
747
- </div>
748
- <div class="member-description hidden">
749
- <div class="member-text">
750
- <p>Detach one or more event handlers from the tool.</p>
751
-
752
-
753
- <ul class="member-list">
754
- <h4>Parameters:</h4>
755
-
756
- <li>
757
- <tt>param:</tt>
758
- <tt>Object</tt>
759
- &mdash;&nbsp;an object literal containing one or more of the following properties: <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>mousemove</tt>, <tt>keydown</tt>, <tt>keyup</tt>
760
-
761
- </li>
762
-
763
- </ul>
764
-
765
-
766
- <ul class="member-list">
767
- <h4>Returns:</h4>
768
-
769
- <li>
770
- <tt><a href="../classes/Tool.html"><tt>Tool</tt></a></tt>&nbsp;&mdash;&nbsp;this tool itself, so calls can be chained
771
- </li>
772
-
773
-
774
- </ul>
775
-
776
-
777
-
778
-
779
-
780
- </div>
781
- </div>
782
- </div>
783
-
784
-
785
- <div id="emit-type-event" class="member">
786
- <div class="member-link">
787
- <a name="emit-type-event" href="#emit-type-event"><tt><b>emit</b>(type, event)</tt></a>
788
- </div>
789
- <div class="member-description hidden">
790
- <div class="member-text">
791
- <p>Emit an event on the tool.</p>
792
-
793
-
794
- <ul class="member-list">
795
- <h4>Parameters:</h4>
796
-
797
- <li>
798
- <tt>type:</tt>
799
- <tt>String</tt>
800
- &mdash;&nbsp;the event type: <tt>&lsquo;mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;keydown&rsquo;</tt>, <tt>&lsquo;keyup&rsquo;</tt>
801
-
802
- </li>
803
-
804
- <li>
805
- <tt>event:</tt>
806
- <tt>Object</tt>
807
- &mdash;&nbsp;an object literal containing properties describing the event
808
-
809
- </li>
810
-
811
- </ul>
812
-
813
-
814
- <ul class="member-list">
815
- <h4>Returns:</h4>
816
-
817
- <li>
818
- <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the event had listeners, <tt>false</tt> otherwise
819
- </li>
820
-
821
-
822
- </ul>
823
-
824
-
825
-
826
-
827
-
828
- </div>
829
- </div>
830
- </div>
831
-
832
-
833
- <div id="responds-type" class="member">
834
- <div class="member-link">
835
- <a name="responds-type" href="#responds-type"><tt><b>responds</b>(type)</tt></a>
836
- </div>
837
- <div class="member-description hidden">
838
- <div class="member-text">
839
- <p>Check if the tool has one or more event handlers of the specified type.</p>
840
-
841
-
842
- <ul class="member-list">
843
- <h4>Parameters:</h4>
844
-
845
- <li>
846
- <tt>type:</tt>
847
- <tt>String</tt>
848
- &mdash;&nbsp;the event type: <tt>&lsquo;mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;keydown&rsquo;</tt>, <tt>&lsquo;keyup&rsquo;</tt>
849
-
850
- </li>
851
-
852
- </ul>
853
-
854
-
855
- <ul class="member-list">
856
- <h4>Returns:</h4>
857
-
858
- <li>
859
- <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the tool has one or more event handlers of the specified type, <tt>false</tt> otherwise
860
- </li>
861
-
862
-
863
- </ul>
864
-
865
-
866
-
867
-
868
-
869
- </div>
870
- </div>
871
- </div>
872
-
873
-
874
-
875
- </div>
876
-
877
-
878
-
879
-
880
- <!-- =========================== copyright notice ========================== -->
881
- <p class="footer">
882
- Paper.js v0.16.0<br>
883
- Copyright &#169; 2011—2026 <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>
884
- <div class="content-end"></div>
885
-
886
-
887
- </article>
888
- </body>