Commit graph

6318 commits

Author SHA1 Message Date
Jürg Lehni
5440f96a77 Shorten new continuous smooth code. 2016-01-15 10:37:04 +01:00
Jürg Lehni
978aaf9f3b Introduce Item flag to selectively activate on stroke-scaling on classes that support it.
Closes #721
2016-01-15 09:56:10 +01:00
Jürg Lehni
1563f69ce9 Layers should not be turning up in hit-tests.
Closes #608
2016-01-14 19:33:48 +01:00
Jürg Lehni
cd366982d6 Some minor improvements in handling of selectedItems. 2016-01-14 19:19:39 +01:00
Jürg Lehni
d9c9b3d1a2 Fix exceptions when a top-level layer is selected.
Getting the parent layer on a top-level layer returns null.
2016-01-14 19:19:14 +01:00
Jürg Lehni
c5ec9ae0b9 Prevent calling constructor methods on existing items again when using importJSON().
Resetting _children to new array would mess up up the code that keeps track of insertion and updateVersions.

Closes #785
2016-01-14 19:12:00 +01:00
Jürg Lehni
495cf9f7ce Remove unused parameter. 2016-01-14 17:44:00 +01:00
Jürg Lehni
cf924512c0 Further streamline and improve tool mouse-event handling. 2016-01-14 14:16:20 +01:00
Jürg Lehni
e2723f0312 Make sure we really don't call preventDefault() if there's only a mousemove handler. 2016-01-14 12:42:33 +01:00
Jürg Lehni
5f44d814f5 Improve handling of previously focused view.
Make sure we switch back to the original one if there are multiple neighboring views.
2016-01-14 11:47:18 +01:00
Jürg Lehni
cee3959bfa Improve handling of temporary view focus switch in mousemove.
Closes #841
2016-01-14 11:43:17 +01:00
Jürg Lehni
edcb2a3868 Handle mouseover events on unfocused views again. 2016-01-14 11:34:48 +01:00
Jürg Lehni
b8a1fbcd67 Implement new convention when to call event.preventDefault() after mouse-events:
- If any of the handlers were called, except for mousemove events which need to call `event.preventDefault()` explicitly, or `return false;`.
- If this is a mousedown event, and the view or tools respond to mouseup.
2016-01-14 11:19:54 +01:00
Jürg Lehni
1a6bf972d5 A lot of fine-tuning and fixing to better handle touch scrolling.
Relates to #686
2016-01-14 10:59:14 +01:00
Jürg Lehni
d5f2ff479d Further overhaul and streamline handling of view and tool mouse-events. 2016-01-14 02:08:33 +01:00
Jürg Lehni
0743f1b7b8 Various optimizations around Project#view. 2016-01-14 01:44:05 +01:00
Jürg Lehni
00a7588a3a Allow any mouse handler to return true in order to enforce browser default.
Relates to #686
2016-01-13 19:04:03 +01:00
Jürg Lehni
0780a87429 Remove unnecessary overrides of selectstart dragstart on view.
And simplify DomEvent.add() / remove(), as we don't need support for multiple types in one entry anymore.
2016-01-13 18:04:54 +01:00
Jürg Lehni
8b0340e6df Have View#_handleEvent() also return true if event is handled.
And use it to call preventDefault() if either tool or view handle events.
2016-01-13 17:53:39 +01:00
Jürg Lehni
6d768f559a A whole lot of code clean-up in tool-event handling. 2016-01-13 17:27:45 +01:00
Jürg Lehni
35aabcc2b2 Move Tool#_updateEvent() to #_handleEvent() as private function. 2016-01-13 17:15:39 +01:00
Jürg Lehni
be0f6e373f Move Tool#_fireEvent() to #_handleEvent() as private function. 2016-01-13 16:48:34 +01:00
Jürg Lehni
799beabf69 Fix a regression in tool event handling.
If a tool has no mousedrag event, fall back on mousemove again.
2016-01-13 16:37:49 +01:00
Jürg Lehni
d7a88d0ef3 Fix endless loop in mousemove evnts caused by changes from #595. 2016-01-13 16:24:22 +01:00
Jürg Lehni
c23d87f5cf Merge remote-tracking branch 'megawac/event-emitting' into megawac-event-emitting 2016-01-13 16:08:33 +01:00
Jürg Lehni
c058e5f664 Fix broken #delta property in mouse-events. 2016-01-13 15:43:48 +01:00
Jürg Lehni
dbc5bd175a Write documentation for View#projectToView(), #viewToProject() and #getEventPoint() 2016-01-13 15:31:09 +01:00
Jürg Lehni
5add1bd725 Implement View#getEventPoint(event)
Relates to #633
2016-01-13 15:26:26 +01:00
Jürg Lehni
2be397c741 Some minor mouse-event related clean-up. 2016-01-13 14:57:04 +01:00
Jürg Lehni
b2ddb29c44 Check in first version of a CHANGELOG for the upcoming v0.10.0 and beyond.
Initiated by @bmacnaughton's push to finally keep a log.
From here onwards, we shall http://keepachangelog.com/
2016-01-13 12:07:04 +01:00
Jürg Lehni
e0d2d0d1b6 Implement simplification proposed by @iconexperiene.
See https://github.com/paperjs/paper.js/issues/899#issuecomment-171220859
2016-01-13 10:21:51 +01:00
Jürg Lehni
d1072d0a88 Remove touchAction:none as we're already calling preventDefault() in selectstart, dragstart
Closes #686.
2016-01-13 10:10:35 +01:00
Jürg Lehni
e477eb8788 Reduce code-size a bit thanks to the use of epslion.
See https://github.com/paperjs/paper.js/issues/878#issuecomment-168153188
2016-01-13 09:11:54 +01:00
Jürg Lehni
016362daee Bring back accidentally removed named constructor. 2016-01-13 02:13:30 +01:00
Jürg Lehni
db2beba831 Large refactoring of mouse-handling code on View and CanvasView.
Added support for:
- Better event bubbling
- mouseenter / mouseleave events on view
- Better handling of mousedrag / mousemove events on item and view
- Support for #removeOn() call in item / view handlers

Closes #845
2016-01-13 02:11:29 +01:00
Jürg Lehni
ab68c5b272 Implement unit tests for #899. 2016-01-12 12:02:27 +01:00
Jürg Lehni
3857be62c4 Increase the fat-line clipping recursion threshold to 26.
As suggested by @iconexperience. Closes #899
2016-01-12 11:59:54 +01:00
Jürg Lehni
0c3406894b In fat-line clipping, increase tDiff threshold back to the recommended 0.8.
As proposed by @iconexperiene in #899. Also remove the unnecessary oldTDiff parameter.
2016-01-12 11:57:10 +01:00
Jürg Lehni
3e3fecb318 Merge pull request #901 from sapics/add-gitignore
Add jshint to node_modules/.gitignore
2016-01-12 00:56:21 +01:00
Jürg Lehni
406d26e884 Unify the way item parents and projects as parents of top-level layers are handled as owners.
This automatically adds support for named children on project.layers, closing #491.
2016-01-12 00:54:04 +01:00
sapics
9bc7cbf5ee Add jshint to node_modules/.gitignore 2016-01-12 08:47:43 +09:00
Jürg Lehni
20f90bbee2 Merge branch 'new-smooth' into develop 2016-01-11 20:26:41 +01:00
Jürg Lehni
4c92c0739e Correctly handle negative smooth() indices on open paths. 2016-01-11 20:21:27 +01:00
Jürg Lehni
4830562e4f Tweak documentation added to Point / Size #min() / #max() a bit. 2016-01-10 18:13:11 +01:00
Jürg Lehni
7b29bb177d Merge remote-tracking branch 'megawac/526-reduce' into megawac-526-reduce 2016-01-10 18:06:11 +01:00
Jürg Lehni
c5eaaff073 Remove ctx.currentPath caching optimization.
Unfortunately all browser have moved away from this again, in favour of Path2D.
2016-01-10 11:51:56 +01:00
Jürg Lehni
4eafe808fa Rename getEndDistanceSquared() to getSquaredLineLength() 2016-01-10 11:50:47 +01:00
Jürg Lehni
9a148700b7 Implement unit test for edge case from #799. 2016-01-09 12:16:50 +01:00
Jürg Lehni
e8390a76d8 Define Path#toShape() and Shape#toPath() as aliases to #clone(). 2016-01-09 12:08:47 +01:00
Jürg Lehni
8639051081 More work and clean-up on JSHint compliance. 2016-01-09 12:05:42 +01:00