code-dot-org/blockly-core — pull request #73 by bcjordan (2014-05-01 19:14:29+00:00)
Title: Add image dimension cache. Fixes offset connection position bug showing up in grunt dev server

**Issue**: Dragging and dropping a dynamically-sized image block out of the toolbox would sometimes (if done with enough velocity) offset the connection area a significant amount, resulting in poor experience until placing the block down.

**Expected**: dragging a block out would always retain its position
**Acutal**: the block's connection (invisible) would be offset some amount

Debug image with connection positions highlighted in yellow:

![image](https://cloud.githubusercontent.com/assets/206973/2856059/58f2cccc-d164-11e3-80fa-9ed9cefe0930.png)

Video of original issue and one way of disabling it (which wasn't itself sufficient since not re-rendering breaks block load in ): http://screencast.com/t/iRu0q6eod

**Resolution:** add a dynamically-loaded image size cache. Since resizing/re-rendering a block only causes a problem when it's mid-drag out of the toolbox, using an image size cache makes the dimensions available for all.

For some reason this issue only repro'd dramatically on the `grunt dev` server, I suspect due to something related to asset load time / caching differences between dashboard and grunt dev blockly.