Commit Graph

169 Commits

Author SHA1 Message Date
picklesrus
e1cd21842a Add a workspace drag surface that blocks and bubble get moved to duri… (#778)
* Add a workspace drag surface that blocks and bubble get moved to during a workspace drag.
The surface is translated using translate3d instead of svg's translate attribute so that
the browser does not have to repaint the entire workspace on every mouse move.
This is very similar to the block drag surface.

* Address code review comments

* add back hasClass_ utility removed in #748 and stop using contains since it is not supported in IE
2016-12-15 11:02:49 -08:00
picklesrus
a82bd49d7e Split the scrollbar and flyout out into their own SVG elements. They (#771)
* Split the scrollbar and flyout out into their own SVG elements. They
are siblings of the workpsace SVG.  This paves the way to make performance
improvements to workspace dragging.
2016-12-09 16:19:19 -08:00
Rodrigo Queiro
8384f8fe05 Make zoom speed independent of event granularity
Before, touchpads would give "smoother" scrolling by delivering lots of
mousewheel events with small distance changes. Because the code only
looked at the sign of deltaY, ten 5px scrolls would zoom 10x more than
one 50px scroll.

This change makes zooming with a touchpad more like zooming with a
mousewheel. On my laptop, a full-scale zoom (fully out to fully in) was
about a 5mm finger movement before, and is now about 3cm.

Fixes #758.
2016-12-09 11:12:28 +01:00
Rachel Fenichel
086fd720b2 Associate flyout button callbacks directly with workspaces 2016-12-08 13:05:19 -08:00
Neil Fraser
97644fdf04 Improve comments. 2016-12-03 06:34:18 -08:00
Neil Fraser
4cda20dbbf Fix speling. 2016-11-19 02:40:11 -08:00
Neil Fraser
f6aef459fc API-breaking cleanup. But doubtful anyone will be affected. (#748)
* Make add/removeClass return whether they did anything.
* Move more functions onto utils.
* Move bind functions to Blockly.
* Routine recompile.
2016-11-15 13:54:33 -08:00
picklesrus
7f02c19bfe Improve performance of block dragging. This is a backport of the blo… (#732)
Improve performance of block dragging.  This is a backport of the block drag surface from scratch-blocks.  At the beginning of a block drag, blocks get moved to a drag surface which then translates using translate3d to avoid repainting the entire svg on every mouse move.  At the end of the drag, the blocks are dropped back in the svg in their new position.
2016-11-15 13:19:49 -08:00
Rachel Fenichel
b5822e2925 Revert "Revert "Rebuild nov 3 16""
This reverts commit c8ca24a000.
2016-11-11 17:05:13 -08:00
Neil Fraser
c8ca24a000 Revert "Rebuild nov 3 16" 2016-11-08 16:46:00 -08:00
Rachel Fenichel
da5c7bcd2a Fix workspace factory bug and rebuild 2016-11-08 16:44:16 -08:00
Rachel Fenichel
80e9a5663c Fix bug with longpress and touch on ios 2016-11-08 16:18:05 -08:00
Andrew n marshall
0156f2e103 Addressing comments from #703 2016-10-28 16:04:57 -07:00
Rachel Fenichel
0c015fd439 Merge pull request #710 from rachel-fenichel/feature/save_load_optimization
Disable resizing the workspace during clearing and loading from xml, …
2016-10-28 15:01:05 -07:00
Neil Fraser
144be4d49f Block highlighting
* Separate block selection (editing) from highlighting (execution).
* Remove add/removeDragging functions. They clutter the API for no reason.
2016-10-26 18:39:56 -07:00
Rachel Fenichel
e2e2a3e298 Disable resizing the workspace during clearing and loading from xml, as an optimization 2016-10-21 14:30:30 -07:00
Andrew n marshall
81499e4392 Merge pull request #703 from AnmAtAnm/alert-confirm-prompt
Adding hooks to support custom alert, confirm, and prompt dialogs
2016-10-20 17:20:00 -07:00
Andrew n marshall
8f3b4bcb5e Replaces calls to window.alert(), window.confirm(), and window.prompt() with Blockly.alert(), Blockly.confirm(), and Blockly.prompt(). These are designed to allow app developers to replace the dialogs with versions that match their own open app, possibly avoiding modal browser dialogs. They each take a callback, so the developer has the opportunity to implement non-modal behavior. 2016-10-20 16:30:40 -07:00
Rachel Fenichel
0537f4829e Merge pull request #685 from trodi/toolbox-typing
Add a few missing type definitions
2016-10-18 17:31:54 -07:00
Neil Fraser
7550cb1e96 Fix loading of Block Factory in Firefox. 2016-10-14 02:20:25 -07:00
Neil Fraser
5df55ddea0 Block(ly) Factory prompts should have defaults. Drop unused copy of colourpicker code. 2016-10-11 12:16:17 -07:00
picklesrus
dad6e47f86 Fix null pointer bug from commit 7928fac3ce. In this context the options object is in "this", not workspace. (#692) 2016-10-11 11:03:03 -07:00
Shannon McCabe
f7bbaaa82d JSDoc format fixes 2016-10-07 14:30:14 -07:00
Neil Fraser
415c6ed65e Add $ back into the ID soup. Issue #251. 2016-10-06 18:52:25 -07:00
Rachel Fenichel
157441f4b1 Add @this annotation to get/set metrics. (#639) 2016-10-06 18:06:41 -07:00
Neil Fraser
7928fac3ce Collapse the five 0/1-based index flags into one option. 2016-10-06 17:54:43 -07:00
Troy McKinnon
ad3541992e add a few type definitions 2016-09-30 16:26:44 -05:00
Rachel Fenichel
ed983333eb bindEventWithChecks_ for internal use, and bindEvent_ with old behaviour but deprecated 2016-09-23 13:46:11 -07:00
Rachel Fenichel
ba1238812f Revert "Revert "Ignore everything but the first touch stream"" 2016-09-23 13:36:53 -07:00
Rachel Fenichel
b2faa41eb1 Revert "Ignore everything but the first touch stream" 2016-09-22 15:26:52 -07:00
Rachel Fenichel
b771d8daf4 Cleanup 2016-09-07 18:14:05 -07:00
Rachel Fenichel
109e4bb352 Move code to touch.js 2016-09-07 17:42:09 -07:00
Rachel Fenichel
c373d6d091 Make context menus work again; fix dragging from the toolbox with variables. 2016-09-07 15:49:20 -07:00
Rachel Fenichel
706d74c81e Handle touches on/in comments and right-clicks on the workspace 2016-09-01 14:15:03 -07:00
Rachel Fenichel
b77c080678 Fix bugs with missing mouseUp events on mutators. Also stop filtering out key presses. 2016-08-25 15:18:53 -07:00
Rachel Fenichel
cc9396d739 Prefer functions in workspaceSvg to functions in blockly.js 2016-08-19 14:13:20 -07:00
rachel-fenichel
21fea1279c Merge pull request #557 from google/feature/variable_management
Integrate variable management into develop.
2016-08-18 15:56:18 -07:00
Katelyn Mann
33e9d75457 Fix for #521.
Add a isMutator member similar to isFlyout to workspace_svg so it knows whether
it is mutator or not. Allow blocks to access that property so that they can recalculate
coordinates appropriately.
2016-08-16 11:19:29 -07:00
rachel-fenichel
c7dea98e88 Merge pull request #534 from picklesrus/develop-screenctm-bugs
Fix for #498.  Recalculate the things that use screen coordinates (de…
2016-08-12 17:15:20 -07:00
Katelyn Mann
244733467d Fix for #498. Recalculate the things that use screen coordinates (delete area and
screen transformation matrix) when a scroll happened.
This is not done using a scroll handler since the update
is expensive (getScreenCTM and getClientBoundingRect) and we don't need to do it
until the scroll is done and the user is interacting with blocks again.
2016-08-12 16:56:22 -07:00
Rachel Fenichel
a2b3a3638a Merge branch 'develop' into feature/variable_management 2016-08-12 14:32:26 -07:00
Katelyn Mann
bbd57a9a16 Fix #536 by changing workspace's dispose method to remove the injectDiv wrapper of the
svg. The wrapper div was introduced in #512.
2016-08-11 11:00:02 -07:00
Rachel Fenichel
350e1ff2cc Merge remote-tracking branch 'upstream/develop' into feature/variable_management_merge_develop 2016-08-08 16:58:51 -07:00
Emma Dauterman
831a14e1e4 Made Blockly.WorkspaceSvg.cleanUp public 2016-08-02 17:18:12 -07:00
rachel-fenichel
b4a938f804 Merge pull request #478 from drigz/bugfix/476
Check flyout in isDragging()
2016-07-19 10:58:48 -07:00
Neil Fraser
4f498dc99c Make tooltips reflect from-end indexing behaviour. 2016-07-15 14:55:05 -07:00
Rachel Fenichel
f040929bd8 Merge remote-tracking branch 'upstream/develop' into feature/merge_develop 2016-07-15 13:07:07 -07:00
Rodrigo Queiro
74e905c611 Check flyout in isDragging()
We also have to record startFlyout_ on background scrolls - before
dragMode_ wasn't being reset by terminateDrag() for background scrolls,
which would suppress clicks from that point on.

Fixes #476.
2016-07-15 10:35:45 +02:00
Rodrigo Queiro
d3d0ca4fd0 Record whether the workspace has been dragged (#475)
* Record whether the workspace has been dragged

This fixes #473 by differentiating between a touch on an unmovable block
and using it to drag the workspace.

* Remove isScrolling and add DRAG_BEGIN

Applied after PR review.
2016-07-12 11:34:02 -07:00
Rodrigo Queiro
ab03c4f411 Remove out-of-date comment (#474)
This comment made sense [before multiple workspace support](67140282a0/core/blockly.js (L297)), where it was near a (Blockly.readOnly || isTargetSvg) check. Now, this logic is implemented in BlockSvg.onMouseDown_() instead.
2016-07-11 16:43:29 -07:00