Commit graph

1945 commits

Author SHA1 Message Date
Jürg Lehni
2605fadcfd Move bounds related code to a proper inejction scope, so we can declare private functions for caching. 2011-11-26 10:18:47 +01:00
Jürg Lehni
de4b5a0d87 Start implementing Item#matrix, work in progress. 2011-11-26 10:15:01 +01:00
Jürg Lehni
92066a6ecb Implement Item#_boundsType as a structure to control bounds handling and caching. 2011-11-24 16:03:05 +01:00
Jürg Lehni
a6b90dea35 Clean up Item documentation. 2011-11-24 16:02:34 +01:00
Jürg Lehni
44b6fe9f0d Fix documentation about bounds beans. 2011-11-24 15:46:06 +01:00
Jürg Lehni
310fbb260b Remove _boundsCache and replace it with easier _simpleBounds flag. 2011-11-24 15:44:26 +01:00
Jürg Lehni
067e0a954b Add comment about LinkedRectangle for 'bounds'. 2011-11-24 15:39:04 +01:00
Jürg Lehni
909b9040d5 Since we only use _createBounds in one place now we can inline it. 2011-11-24 15:38:08 +01:00
Jürg Lehni
569c415b2f Start implementing bounds caching the new way.
Work in progress still.
2011-11-24 15:37:44 +01:00
Jürg Lehni
c989d3ee3f Restructure code a bit for easier reading. 2011-11-24 15:18:57 +01:00
Jürg Lehni
ea87be166e Part one of big refactoring of bouding box handling. Functional, but caching is broken right now. 2011-11-24 15:13:21 +01:00
Jürg Lehni
d9777111dc No need for an injection scope as we can also just use Base.each() in combination with a side-car. 2011-11-24 14:54:04 +01:00
Jürg Lehni
b96cd4e1c8 Add comments about possible optimization of accessing of style properties. 2011-11-24 14:53:38 +01:00
Jürg Lehni
1d6cfeeb9b Add dest and dontNotifty arguments to Matrix#_transformBounds() and use them where appropriate. 2011-11-24 11:29:35 +01:00
Jürg Lehni
3f5e68aa76 Document the private getPendPadding() function. 2011-11-24 10:21:12 +01:00
Jürg Lehni
29aaf38320 Improve comments. 2011-11-24 10:17:31 +01:00
Jürg Lehni
8a53288b1e Add comment about upcoming changes relating to bounds. 2011-11-23 18:13:21 +01:00
Jürg Lehni
cd1810e6a3 Fix arguments check in Path#getHandleBounds(). 2011-11-23 18:13:05 +01:00
Jürg Lehni
11f298c994 Start adding support for PointText#bounds and multi-line text, work in progress. 2011-11-23 18:12:41 +01:00
Jürg Lehni
eb70c4de5d Directly pass matrix argument to _getBounds() instead of whole arguments array. 2011-11-20 18:51:34 +01:00
Jürg Lehni
75072bde4f Directly access project.view. 2011-11-18 20:33:27 +01:00
Jürg Lehni
44291fe33b Support injecting multiple object parameters into Style classes. 2011-11-18 20:08:54 +01:00
Jürg Lehni
5f0da04daf Add empty line at file end. 2011-11-18 19:54:16 +01:00
Jürg Lehni
b9f6c99dcd Add comments and clean up code. 2011-11-17 19:28:05 +01:00
Jürg Lehni
427cc21b3a Fix a comment. 2011-11-17 00:06:21 +01:00
Jürg Lehni
1b484a2f7b Implement MouseEvent#delta for Item#onMouseDrag and #onMouseMove. 2011-11-17 00:04:30 +01:00
Jürg Lehni
cf54b1a7c1 Change parameter sequence in mouse event code. 2011-11-16 23:47:51 +01:00
Jürg Lehni
9061daa935 Simplify event handling code. 2011-11-16 23:41:47 +01:00
Jürg Lehni
80d3763c39 Implement Item#onMouseDrag evnets, and have them silence #onMouseMove events if both are present. 2011-11-16 23:30:14 +01:00
Jürg Lehni
d066ad775d Implement Item#onClick and #onDoubleClick. 2011-11-16 23:18:27 +01:00
Jürg Lehni
b3bf57c8e9 Implement Item#onMouseEnter / #onMouseLeave. 2011-11-16 22:59:39 +01:00
Jürg Lehni
c0e6d5b2ee Remove unused injection scopes. 2011-11-16 22:54:03 +01:00
Jürg Lehni
44bf596e51 Finish implementing Item#onMouseMove and clean up code. 2011-11-16 22:48:38 +01:00
Jürg Lehni
8efc7ce7cd Implement Item#onMouseUp events and work on #onMouseMove. 2011-11-16 22:41:22 +01:00
Jürg Lehni
57bd659023 Move Item base mouse handling code to CanvasView. 2011-11-16 13:12:41 +01:00
Jürg Lehni
577c884a70 Prepend non-public Tool methods with '_'. 2011-11-16 13:10:39 +01:00
Jürg Lehni
1eff9741a4 Separate Canvas related code from View into CanvasView class. 2011-11-14 20:18:08 +01:00
Jürg Lehni
c85f0326c3 Simplify installling of mouse handlers in View. 2011-11-14 13:32:03 +01:00
Jürg Lehni
acbebc2aa4 Remove #idleInterval left-overs. 2011-11-13 00:09:09 +01:00
Jürg Lehni
fcd92c4ac1 Fix updateFocus() documentation. 2011-11-13 00:05:28 +01:00
Jürg Lehni
c8e1a9c959 Merge remote-tracking branch 'origin/master' 2011-11-12 23:57:39 +01:00
Jürg Lehni
e4586cfeeb Commit beginning of item based mouse events. So far only onMousedown / 'mousedown' is supported. 2011-11-12 23:57:25 +01:00
Jürg Lehni
18d44689fa Fix white-space in code example. 2011-11-12 23:56:25 +01:00
Jürg Lehni
36846d6e38 Remove code from previous commit again. 2011-11-12 19:52:36 +01:00
Jürg Lehni
d89d7f1ef7 Commit temporary support for attach() and detach() handler on event entries, to be removed again. 2011-11-12 19:51:51 +01:00
Jürg Lehni
4ba752d42a Add note and TODO about Path#contains() only working correctly for no-zero winding rule, which is not used by Canvas... 2011-11-12 19:49:12 +01:00
Jürg Lehni
ddf7c6534b Fix Path#hitTest() to only consider strokeWidth if a strokeColor is provided too. 2011-11-12 19:48:39 +01:00
Jonathan Puckey
52385451f6 Resolve a few documentation todos. 2011-11-12 18:30:21 +01:00
Jürg Lehni
6e5a81f907 Fix white-spaces in documentation. 2011-11-12 18:26:15 +01:00
Jürg Lehni
c33998c140 Remove support for Tool#eventInterval. 2011-11-12 18:26:03 +01:00
Jürg Lehni
52ad906c97 Add support for onFrame handlers on Item. 2011-11-12 17:44:05 +01:00
Jürg Lehni
d9ba90ea2d Remove white space. 2011-11-12 17:15:04 +01:00
Jürg Lehni
8eaddc759e Fix code sequence when attaching and detaching event handlers. 2011-11-12 17:14:49 +01:00
Jürg Lehni
da5a837da2 Merge remote-tracking branch 'origin/master' 2011-11-12 16:56:35 +01:00
Jürg Lehni
719ae2315c Remove global views list, link View to Project and allow projects to only have one view. 2011-11-12 16:56:23 +01:00
Jonathan Puckey
3ac171a304 Path#smooth() example: select path using fullySelected instead of selected, so we can see its handles. 2011-11-12 16:45:33 +01:00
Jonathan Puckey
d631288dc7 Fire resize event directly after evaluation, so we don't need to call onResize ourselves from PaperScript. 2011-11-12 16:31:22 +01:00
Jürg Lehni
ea689faa43 Fix white space. 2011-11-12 15:50:53 +01:00
Jürg Lehni
07839cf683 Add comment about name being set again in addChild(). 2011-11-12 15:50:35 +01:00
Jürg Lehni
2b5cfa401a Remove obsolete documentation. 2011-11-12 14:41:27 +01:00
Jürg Lehni
24f07dccec Clean up some JSDoc comments. 2011-11-12 13:27:29 +01:00
Jürg Lehni
b1332331b0 Simplify injection scope for removeOn* methods. 2011-11-12 13:22:45 +01:00
Jürg Lehni
a326b189b4 Improve Curve#isFlatEnough() by finding the right threshold through testing, and remove other less precise solutions. 2011-11-12 01:23:41 +01:00
Jürg Lehni
d43b54a531 Shorten Curve.isFlatEnough() code. 2011-11-11 20:58:33 +01:00
Jürg Lehni
fdd4ee8d31 Switch back to Kaspar Fischer's version of Curve.isFlatEnough, as it produces the best results with dashed lines. 2011-11-11 20:55:31 +01:00
Jürg Lehni
3dfb4d3ae5 Make Item#removeOn() calls work with new event callback mechanism. 2011-11-11 20:41:09 +01:00
Jürg Lehni
78d1ce1540 Make new events work properly for key handlers. 2011-11-11 20:12:29 +01:00
Jürg Lehni
e238dea3ac More work to make new events mechanisms work for Tool too. 2011-11-11 19:49:31 +01:00
Jürg Lehni
5fd7753c60 Remove dev comments. 2011-11-11 18:39:12 +01:00
Jürg Lehni
eaa5f97e95 Merge remote-tracking branch 'origin/master' 2011-11-11 18:29:44 +01:00
Jürg Lehni
256e48b511 Define Callback code for callback based event handling (#atach() / #detach() #fire()) and start implementing it in View. 2011-11-11 18:29:28 +01:00
Jonathan Puckey
a96a92caba Add support for hit testing Raster items and getting the color of the pixel that was hit. 2011-11-11 15:00:53 +01:00
Jürg Lehni
af9df0e1b8 Provide point of hit handles and segments too in HitResult. 2011-11-11 14:47:03 +01:00
Jürg Lehni
99a8532cca No need to set beans = true since we're always producing beans. 2011-11-11 14:03:36 +01:00
Jürg Lehni
1124236b8a Use inject() instead of a each() loop to add values to HitResult, so getters can be defined too (required for raster hit testing). 2011-11-11 13:11:10 +01:00
Jürg Lehni
e2eec3476d Add comments about backward compatible Color constructor names. 2011-11-10 20:00:20 +01:00
Jürg Lehni
42d0e722db Rename RGBColor -> RgbColor, to avoid clash with native constructor, and follow same naming convention for HsbColor and HslColor, but keep references to old names for PaperScript scopes for now. 2011-11-10 19:16:34 +01:00
Jürg Lehni
c4bea4d24c Include comment about algorithm modifications. 2011-11-10 18:30:18 +01:00
Jonathan Puckey
eb34e058c0 Fix bug in Item#hitTest and Project#hitTest documentation. Closes #57 2011-11-10 15:14:49 +01:00
Jürg Lehni
34b5d043b3 Implement Matrix#inverseTransform(). 2011-09-23 11:19:03 +02:00
Jürg Lehni
4600fe1e21 Add comments about alternative arguments. 2011-09-23 11:18:25 +02:00
Jürg Lehni
d1d110f085 Document the two versions of Matrix#transform() separately. 2011-09-23 11:17:42 +02:00
Jürg Lehni
f8dac43107 Remove Matrix#determinant and convert getter to private method that only returns determinant if matrix is reversible, simplifying the various places where _getDeterminant is in use. 2011-09-22 21:19:41 +02:00
Jürg Lehni
3397931bb2 Be consistent in Numerical. EPSILON comparison rules. 2011-09-22 21:14:16 +02:00
Jürg Lehni
44e5c30436 Remove misleading alternative parameter comment. 2011-09-22 10:36:27 +02:00
Jürg Lehni
6052e94a2a Add basic code for fine-grained change tracking, as required by on-the fly SVG DOM manipulation. 2011-09-22 10:32:17 +02:00
Jürg Lehni
a2358a0fc0 Also fire key events for modifier keys. Closes #52. 2011-09-18 12:51:03 +02:00
Jürg Lehni
571ca31dbf Move ctx.restore() to same level as ctx.save(). Closes #51. 2011-09-18 10:56:04 +02:00
Jürg Lehni
b51c1286da Add documentation for all color components. Closes #43. 2011-09-18 10:54:26 +02:00
Jürg Lehni
8db7352342 Merge branch 'master' of github.com:paperjs/paper.js 2011-09-18 10:38:33 +02:00
Jürg Lehni
936fd43c37 Implement Item#layer. 2011-09-18 10:38:16 +02:00
Ben Ogle
7ebd4a17bd Adds other keycodes for command keys in different browsers.
- 224 for firefox
 - 93 for the right command key in WebKit browsers.
2011-08-25 18:53:30 -07:00
Jürg Lehni
ae116cd043 Improve comments about change notifications. 2011-08-23 16:36:57 +02:00
Jürg Lehni
7a5ca5609f Have View#_redraw() properly redraw the content even if nothing has changed inside. 2011-08-23 16:36:18 +02:00
Jürg Lehni
79f351e5ee No need to check for _project as it will always bet set. 2011-08-23 16:35:19 +02:00
Jürg Lehni
a775ddec9e Remove obsolete comment. 2011-08-22 11:14:49 +02:00
Jürg Lehni
b54f9f2228 Introduce View#_redraw() and use it in #setViewSize() and #_transform(). 2011-08-22 11:14:38 +02:00
Jürg Lehni
3ca165f413 Move #_transform() up. 2011-08-22 11:13:42 +02:00
Jürg Lehni
a081419a8b Fix View#bounds for zoom levels other than 1. 2011-08-22 11:12:40 +02:00
Jürg Lehni
7c2fabd6a1 Remove redundant scope by sharing one between browser and server code. 2011-08-22 11:05:59 +02:00
Jonathan Puckey
0ee1e80c68 Node.js: add Raster support. 2011-08-21 16:38:06 +02:00
Jonathan Puckey
a28b20dac8 Merge branch 'master' of https://github.com/paperjs/paper.js 2011-08-20 15:55:48 +02:00
Jonathan Puckey
bec8cf967e View: add documentation todos. 2011-08-20 15:51:54 +02:00
Jonathan Puckey
1f9993f894 Move Node.js specific things to dedicated folder. 2011-08-20 15:48:57 +02:00
Jonathan Puckey
70dc88ca91 View: Clean up #exportImage() and #exportFrames(). 2011-08-20 15:46:06 +02:00
Jonathan Puckey
197c2670d6 Implement View#exportImage(uri, param) 2011-08-18 11:11:24 +02:00
Jürg Lehni
76df9d9a92 Fix documentation for beans. 2011-08-16 13:53:36 +02:00
Jürg Lehni
4e1dd90549 Use faster Size.create(). 2011-08-16 13:52:31 +02:00
Jürg Lehni
4dd90b440e Use new dontLink parameter for Path.Constructors optimisations. 2011-08-16 13:52:18 +02:00
Jürg Lehni
c9eb538f7a Support an optional argument 'dontLink' in getters that normalled return LinkedPoint and LinkedSize objects, for internal use. 2011-08-16 13:50:59 +02:00
Jürg Lehni
8f8188a091 Optimise Path.Rectangle constructor. 2011-08-16 13:39:37 +02:00
Jürg Lehni
3c5a46a8af Implement SegmentPoint#isZero() that does not use the x / y accessors but the internal properties directly, for performance reasons, since it is used a lot internally. 2011-08-16 13:38:52 +02:00
Jürg Lehni
7e0307dd6a Correct comments. 2011-08-16 13:36:58 +02:00
Jonathan Puckey
25cb4a7dd1 Support running of PaperScript .pjs files. 2011-08-13 18:26:43 +02:00
Jonathan Puckey
38a4184ab5 Color: Avoid dividing by 0 in rgb-hsl converter. 2011-08-13 15:26:14 +02:00
Jonathan Puckey
8ce7ed578e Allow loading of Paper.js on Node.js without the need for compiling. 2011-08-10 21:02:32 +02:00
Jonathan Puckey
ebc3b3789b Merge branch 'master' of https://github.com/paperjs/paper.js 2011-08-10 18:30:42 +02:00
Jonathan Puckey
e82a838085 Fix problem in Item#rasterize(resolution) where rasterizing the active layer caused the resulting Raster to be positioned wrongly. 2011-08-08 18:43:45 +02:00
Jonathan Puckey
a58bbaf6cf Fix Size#isZero(). 2011-08-04 15:06:35 +02:00
Jonathan Puckey
24f5188c24 Merge remote-tracking branch 'origin/master' 2011-08-04 10:55:02 +02:00
Jonathan Puckey
3a3f5ecabb Segment: notify path of change when selection state of handles changes, so the view is redrawn. 2011-08-04 10:54:56 +02:00
Jürg Lehni
4e78c55859 Simplify PointText#setPoint() 2011-08-03 23:37:56 +02:00
Jürg Lehni
7c95eb7694 Do not usse LinkedPoint internally for PointText#point, since we're returning new instances each time now in #getPoint(). 2011-08-02 16:08:00 +01:00
Jonathan Puckey
fe1b2ca8a0 Fix PointText#setPoint(point) and PointText#setPosition(point). 2011-08-02 14:31:35 +02:00
Jürg Lehni
fe97b94340 Define PaperScopeItem as a private base class for all classes that have lists and references in the PaperScope (Project, View, Tool), so they can share functionality (#initialize(), #activate(), #remove()), and add support for multiple tools. Closes #27 2011-08-02 10:08:08 +01:00
Jonathan Puckey
a9780374f2 Remove logging statements. 2011-08-02 11:07:59 +02:00
Jonathan Puckey
94a6860f7f Add back Node.js related changes to View. 2011-08-02 11:02:04 +02:00
Jonathan Puckey
820ef43f56 Merge remote-tracking branch 'source/master' 2011-08-02 10:53:25 +02:00
Jonathan Puckey
30e2ba5582 Update View. 2011-08-02 10:49:40 +02:00
Jürg Lehni
2d5788540d Hide internal properties even if they are enumerable in Base#toString() 2011-08-02 08:32:55 +01:00
Jürg Lehni
14881b8b19 Let View handle the retrieving of the canvas object. 2011-08-01 16:23:56 +01:00
Jürg Lehni
828c3ae369 Doc: Improve View#initialize(canvas). 2011-08-01 16:21:00 +01:00
Jürg Lehni
9195f026d7 Support passing canvas ids straight to View constructor. 2011-08-01 16:18:17 +01:00
Jürg Lehni
022de4d781 Some documentation fixes for v0.2 2011-08-01 14:25:46 +01:00
Jürg Lehni
ea629fefda Remove debug log. 2011-08-01 12:03:23 +01:00
Jürg Lehni
14895f412c Fix PaperScope#install() so classes actually get injected. 2011-08-01 12:02:50 +01:00
Jürg Lehni
a8c08b3301 Docs: Document Path#getNearestLocation() and #getNearestPoint(). 2011-08-01 11:48:27 +01:00
Jürg Lehni
c8578658ae Docs: Remove |null from @return, since it's verbally described, and null can also be a HitResult. 2011-08-01 11:48:07 +01:00
Jürg Lehni
31cc571e8a Docs: Hide matrix parameter in Item#hitTest() and add "options." in front of each options property. 2011-08-01 11:47:42 +01:00
Jürg Lehni
884ea96a29 Docs: Link HitResult back to #hitTest() functions. 2011-08-01 11:47:08 +01:00
Jürg Lehni
8cdc5ea2aa Change PaperScope#install() to be clever about project, view and tool references and link them through a getter to their current state in PaperScope. 2011-08-01 11:21:22 +01:00
Jürg Lehni
3fc21cd4b6 Always call View#draw() since it won't redraw internally if nothing has changed. 2011-08-01 11:02:00 +01:00
Jürg Lehni
6b6d5909c1 Revert back to PaperScope#setup() and keep #initialize0 simple. 2011-08-01 11:01:27 +01:00
Jürg Lehni
6086165d1a Merge remote-tracking branch 'origin/master' 2011-08-01 08:56:07 +01:00
Jürg Lehni
0e6aeac28c Fix HSLColor documentation. 2011-08-01 08:53:28 +01:00
Jürg Lehni
5b963b13e1 Export classes through PaperScope in dev mode too. 2011-08-01 08:53:07 +01:00
Jürg Lehni
c6cf4f9cf0 Only create an empty Project for a PaperScope if a canvas was provided for it. 2011-08-01 08:52:51 +01:00
Jonathan Puckey
e0650cae73 Document HitResult, Item#hitTest(point, options) and Project#hitTest(point, options). 2011-07-31 22:58:51 +02:00
Jürg Lehni
fc7da5fa13 Docs: Improve HSL example. 2011-07-31 15:46:26 +01:00
Jürg Lehni
42c9f91279 Rename internal Matrix transform parameters to (a, c, b, d, tx, ty), expoes values through Matrix#getValues() and improve documentation. 2011-07-31 15:26:09 +01:00