Commit graph

67 commits

Author SHA1 Message Date
Jürg Lehni
d92628a432 Make click and doubleclick events work on View. 2016-01-27 11:38:45 +01:00
Jürg Lehni
3276616f53 Introduce Item._itemHandlers to remove code redundancy. 2016-01-27 11:38:14 +01:00
Jürg Lehni
849688833e Implement key events on View.
Closes #896
2016-01-27 11:36:39 +01:00
Jürg Lehni
8391543115 Further improve Raster documentation. 2016-01-27 10:39:03 +01:00
Jürg Lehni
c5632d8a6a Improve documentation for event handlers on View and Item. 2016-01-27 10:27:14 +01:00
Jürg Lehni
52017340d2 Do not fire two subsequent mousedown events.
This should fix #922, but needs testing.
2016-01-27 09:53:09 +01:00
Jürg Lehni
caa93a51ca Improve handling of removeOn*() and filter out duplicate move events.
Closes #913
2016-01-27 09:48:20 +01:00
Jürg Lehni
ee4760afc4 Fix issue with zoomed retina canvases when repeatetly initializing same view canvas. 2016-01-27 09:38:57 +01:00
Jürg Lehni
86f6d8eccd Fix crash in unit tests. 2016-01-26 23:27:38 +01:00
Jürg Lehni
4af8999135 Clean up View#_handleFrame() 2016-01-26 22:35:46 +01:00
Jürg Lehni
b71ffdbe71 Remove all direct calls to view.update() and favor of the new view.requestUpdate()
Pure window.requestAnimationFrame() smoothness, automatic updates even when working directly from JavaScript, and no more slow-downs from onLoad events!

Closes #830, #925
2016-01-26 21:37:27 +01:00
Jürg Lehni
e1a51f858a More work on unified version for browsers and node.
Relates to #739
2016-01-26 20:02:23 +01:00
Jürg Lehni
c479ec9272 Start with transition to unified version.
Relates to #739
2016-01-26 11:41:49 +01:00
Jürg Lehni
d292e08ed2 Various renaming and introduction of additional methods in Matrix
- Rename Matrix#concatenate() to #append() and #preConcatenate() to #prepend().
- Over #invert() as alternative to #inverted(), directly modifying the matrix.
- Make Matrix#_shiftless() and internal function.
- Introduce versions that return copies instead, named #appended(). (previously #chain()) and #prepended().
- Rename internal Path#_getPenPadding() to #_getStrokePadding().
2016-01-17 19:30:47 +01:00
Jürg Lehni
7783ebeed1 Explain reasons for /* jshint */ statements.
And consistently name Prepro.js
2016-01-16 15:37:02 +01:00
Jürg Lehni
3a3d46692b Give view proper Matrix transformation functions, just like on Item.
Relates to #832
2016-01-16 15:10:28 +01:00
Jürg Lehni
7fa013092e Define View#matrix, giving access to more fine-grained control over the view transformation.
Relates to #832
2016-01-16 14:25:11 +01:00
Jürg Lehni
2669d06642 Merge Item#_remove() and Layer#_remove().
And add Project#_changed(), so it can be called through #_getOwner().
2016-01-16 14:21:05 +01:00
Jürg Lehni
1bc2d2fffe Fix bug with mouse events in scripts without tools. 2016-01-15 23:45:58 +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
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
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
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
8639051081 More work and clean-up on JSHint compliance. 2016-01-09 12:05:42 +01:00
Jürg Lehni
f2ae7840cf A lot of work on documentation.
- @values lists
- Improve event documentation
- Compound path
- etc.
2016-01-08 20:45:54 +01:00
Jürg Lehni
3280b5700c Get things up to speed again with JSHint. 2016-01-08 18:16:29 +01:00
Jürg Lehni
7152942719 Replace links to issues with short references. 2016-01-06 14:13:02 +01:00
Jürg Lehni
44f98ee094 Replace all mention of DOM in the documentation with scene graph. 2015-12-30 21:55:21 +01:00
Jürg Lehni
0e427c16a2 Fix some white-spaces in comments and HTML. 2015-12-30 21:55:20 +01:00
Jürg Lehni
cc1e58e243 Improve Chrome fix to handle wrong coordinates in both directions.
Closes #800.
2015-12-30 21:55:19 +01:00
Jürg Lehni
21f4141e4f Fix werid mouse event issue on Chrome / Windows.
Closes #800
2015-12-30 21:55:19 +01:00
Jürg Lehni
a7a07fb6d5 Update JSDoc and do some documentation spring-cleaning.
- Convert from {@code ...} to shorter `...`
- Reformat some documentation comment blocks
- Update copyright notices
2015-12-30 21:55:19 +01:00
Jürg Lehni
401877c6dc Fix the correct bubbling of doubleclick events.
Fixes #834.
2015-12-30 21:55:17 +01:00
Jürg Lehni
8eb0dcc87d Fix various JS linting problems. 2015-10-27 23:35:30 +01:00