code-dot-org/code-dot-org — pull request #78 by Bjvanminnen (2014-10-01 17:00:18+00:00)
Title: More block_svg cleanup

This diff is going to be a little difficult to read since I moved some large chunks of code around. It's another set of changes that should have no functional impact. My hope/expectation is that I should now be at the point where things are broken down enough that I can start making changes. (The next change is to create a way to have internal connections that take statements as inputs instead of values). The things I've done in this PR:

(1) Moved brokenControlPoints hack into a single location
(2) Moved cursorX/cursorY into a single location in steps instead of having these scattered about in the code in various location. I'm open to suggestions on something better than steps to call this variable now.
(3) Split renderDrawRight_ into a few different functions by type.
(4) We have some code in our renderDraw functions that moves connections around. Originally I thought this better placed in its own function separate from the path generation logic. However, in some cases we do this based on the current location (steps.curX/curY), so I decided to return it to the renderDraw functions in all cases.

Validation I've done:
- Looked at http://staging.learn.code.org/s/1/level/108 side by side with my localhost copy and verified that they look exactly the same.
- Looked through the blocks in the tool box at http://localhost:3000/2014/11 (our playlab level with lots of blocks) and made sure things looked good.
- Took a look at Jigsaw blocks.