Commit Graph

18 Commits

Author SHA1 Message Date
Neil Fraser
8cedef49ac Cleanup. 2017-11-07 14:23:41 -08:00
Sam El-Husseini
9c0de1ae8d Avoid IE and Edge re-rendering (#1326)
* Fix wrong width of field_dropdown with an image on Edge / IE

* Avoid re-rendering on IE and Edge by using getBBox().width to compute the text width on those browsers
2017-09-19 15:04:25 -07:00
Rachel Fenichel
71066faff6 Move blockSvg.getHeightWidth to block_render_svg.js (#1118) 2017-05-24 13:38:46 -07:00
Tim Dawborn
d55d9cbd9f Attempt to work around the IE/Edge bug where getComputedTextLength() throws an exception when the SVG node is not visible. This workaround forces a re-render, which in turn, forces a re-calculation of the node width once a block is inserted into the workspace SVG. This workaround is only executed on IE and Edge. See https://groups.google.com/forum/#!topic/blockly/T8IR4t4xAIY for the initial discussion of this issue. 2017-01-27 15:15:09 +11:00
Neil Fraser
4cda20dbbf Fix speling. 2016-11-19 02:40:11 -08:00
Rachel Fenichel
cc9396d739 Prefer functions in workspaceSvg to functions in blockly.js 2016-08-19 14:13:20 -07:00
picklesrus
213469a479 Change the blockly workspace resizing strategy. (#386)
* Add a new method to be called when the contents of the workspace change and
the scrollbars need to be adjusted but the the chrome (trash, toolbox, etc)
are expected to stay in the same place.

Change a bunch of calls to svgResize to either be removed or call the new
method instead.  This is a nice performance win since the offsetHeight/Width
call in svgResize can be expensive, especially when called as often as we do -
there was some layout thrashing.

This also paves the way for moving calls to recordDeleteAreas
(which is also expensive) to a more cacheable spot than on every
mouse down/touch event.

of things (namely the scrollbars)

* Fix size of graph demo when it first loads by calling svgResize.
The graph starts with fixed width and was relying on a resize event
to fire (which I believe was removed in commit
217c681b86).

* Fix the resizing of the code demo.  The demo's tab min-width used to
match the toolbox's width was only being set on a resize event, but
commit 217c681b86 changed how that worked.

* Fix up some comments.

* Use specific workspaces rather than Blockly.getMainWorkspace().

* Make workspace required for resizeSvgContents and update
some calls to send real workspaces rather than ones that are
null.

Remove the private tag on terminateDrag_ because it is only
actually called from outside the BlockSvg object.

* Remove a rogue period.

* Recategorize BlockSvg.terminateDrag_ to @package instead of @private so that
other developers don't use it, but it still can be used by other Blockly classes.

* Add a TODO to fix issue #307.

* Add @package to workspace resizeContents.
2016-06-03 16:11:55 -07:00
Rachel Fenichel
c3f27127d3 lint 2016-06-01 15:31:43 -07:00
Rachel Fenichel
66ca80c42f Make function private 2016-05-31 15:48:32 -07:00
Rachel Fenichel
03de6b6a92 Move connections at the end of render, instead of in the middle of drawing 2016-05-31 15:39:08 -07:00
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Rachel Fenichel
8597c94a49 lint 2016-05-24 15:35:38 -07:00
Neil Fraser
217c681b86 Use direct call to svg resize rather than event. Also fix issue #296. 2016-05-04 15:00:57 -07:00
Neil Fraser
6c0bf9f966 Routine recompile. 2016-04-21 06:05:25 -07:00
Katelyn Mann
79f91266ac Take into account height of the hat for hat blocks.
Also, position hat blocks correctly in the flyout/toolbox.
This fixes #330.
2016-04-12 14:59:58 -07:00
rachel-fenichel
ae1a0aab8a add isConnected() to connections. 2016-03-30 15:10:59 -07:00
Rachel Fenichel
0a363803f0 Clean up removeConnection; port in more tests. 2016-02-26 14:41:49 -08:00
Rachel Fenichel
9de572283e Refactor: pull rendering code out of block_svg 2016-02-25 13:55:36 -08:00