In this fiddle, the placement of the tiles is correct. However, the button checks if widget "5" can move up. The can_go_up method says that it can, even though it doesn't look like it should. In fact, if you drag widget "5" up a few pixels, it will drop on top of widget "3".
The cause of the problem: when adding tiles 4 and 5, the gridmap is extended by a few rows (as part of the add_to_gridmap call done by register_widget). After the call to register_widget, add_faux_rows extends the rows of the gridmap using the old row count, thereby clearing out some of the gridmap locations just reserved by add_to_gridmap. All of the collision functionality relies on a correct representation of the grid in the gridmap.
See fiddle: http://jsfiddle.net/ngEGa/
In this fiddle, the placement of the tiles is correct. However, the button checks if widget "5" can move up. The can_go_up method says that it can, even though it doesn't look like it should. In fact, if you drag widget "5" up a few pixels, it will drop on top of widget "3".
The cause of the problem: when adding tiles 4 and 5, the gridmap is extended by a few rows (as part of the add_to_gridmap call done by register_widget). After the call to register_widget, add_faux_rows extends the rows of the gridmap using the old row count, thereby clearing out some of the gridmap locations just reserved by add_to_gridmap. All of the collision functionality relies on a correct representation of the grid in the gridmap.