Commit graph

111 commits

Author SHA1 Message Date
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
Jürg Lehni
3314668a0c Streamline mouse event handling between View and Item.
Consolidating code and making View#onMouseDown/Up/Move/... events work.
2015-10-14 16:25:36 +02:00
Jürg Lehni
b52d343527 Use same notation for all injection scopes. 2015-09-06 16:48:23 +02:00
Jürg Lehni
eb8c5b4a3e Handle em and pt font sizes correctly on Firefox.
Closes #734
2015-08-19 12:57:22 +02:00
Jürg Lehni
b541088c6f A whole lot of documentation clean-up. 2015-06-16 17:50:37 +02:00
Jürg Lehni
783d1622b9 Remove faulty character. 2015-05-11 19:15:52 +02:00
Jürg Lehni
8174405924 Include force parameter in View#update()
Closes #675.
2015-04-12 15:23:24 +02:00
Jürg Lehni
23ec75f5d2 Read CanvasView size correctly from arguments array. 2015-02-27 18:00:36 +01:00
Jürg Lehni
95a8539045 Fix size issue on non-resizable HiDPI canvases.
Reverting back to original behavior in #586.
2015-01-02 14:38:06 +01:00
Jürg Lehni
a07dc98046 Clean up and simplify code from pull request #580 and fix CSS in examples accordingly. 2014-12-30 00:16:51 +01:00
George Reith
6f1c3145bf Fixes #580 where resizable views were only taking into account their offset from the top left of the viewport. 2014-12-04 13:01:02 +00:00
Jürg Lehni
19a9976939 Return emitter in #on(), #off(), #once(), so calls can be chained. 2014-11-18 14:56:55 -08:00
Jürg Lehni
99ef521af4 Switch from inline @option tags to real doc tags. 2014-10-20 23:33:28 +02:00
Jürg Lehni
77f6e68846 Remove documentation for deprecated #attach() methods. 2014-10-15 13:01:59 +02:00
Jürg Lehni
3b2a82047e Clean up event related comments, to reflect recent renaming. 2014-10-08 18:33:17 +02:00
Jürg Lehni
c7c49d4091 Time to go with the flow and use the on()/off()/emit() pattern for events. 2014-10-08 14:57:56 +02:00
Jürg Lehni
3dc5c94e25 Rename Callback mix-in to Emitter. 2014-10-08 14:13:08 +02:00
Jürg Lehni
e46a1d24da Move View classes to their own folder.
That's not really UI.
2014-10-04 16:51:58 +02:00