Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement block shapes to latest spec #99

Closed
wants to merge 51 commits into from
Closed

Implement block shapes to latest spec #99

wants to merge 51 commits into from

Conversation

tmickel
Copy link
Contributor

@tmickel tmickel commented Mar 1, 2016

-Convert most constants in the code to use multiplications of GRID_UNIT (4px). This lets us be consistent with Carl's specs and helps explain the numbers a little better.
-Implement notches using cubic curves instead of arcs. This version matches the spec pretty much exactly. As part of this, remove NOTCH_BASE_HEIGHT which is no longer relevant.
-Slight simplification of renderCompute_ (which calculates metrics).
-Fixed SEP_SPACE_X and SEP_SPACE_Y to be the correct number of grid units. Our blocks before were slightly too small, now they are the right size.
-Implement the correct corner radius, hat/end hat radius.
-Add fixed ICON_WIDTH and ICON_HEIGHT, i.e., always size the icons to 40x40px as according to the spec.
-Add fixed STATEMENT_BLOCK_SPACE to represent the size of the bar above forever/repeat/pants blocks. Previously the code was assuming this was SEP_SPACE_Y, when in fact the spec has it as larger (4 units).
-Add accurate MIN_BLOCK_X and MIN_BLOCK_Y for simpler calculation of minimum bay size.
-Remove some unused SVG paths (INNER_TOP_LEFT_CORNER, INNER_BOTTOM_LEFT_CORNER).
-Remove extra code in getHeightWidth which caused a bug in rendering forever-in-repeat.
-Fix stroke width around the blocks to be 1px, according to spec.

I've checked that everything lines up with Carl's spec images at 8x zoom.

This should implement #69, #70, #71, #72, #74, and #75 (not 73 as we haven't done that input yet).

steps.push('a', Blockly.BlockSvg.CORNER_RADIUS + ',' +
Blockly.BlockSvg.CORNER_RADIUS + ' 0 0,0 ' +
Blockly.BlockSvg.CORNER_RADIUS + ',-' +
Blockly.BlockSvg.CORNER_RADIUS);
steps.push('v', -8);
steps.push('v', -10);

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@thisandagain
Copy link
Contributor

This looks great @tmickel . One minor nitpick but otherwise good to land. How would you feel about squashing these commits?

@tmickel tmickel closed this Mar 1, 2016
@tmickel tmickel deleted the feature/block-shape branch March 1, 2016 20:29
@rachel-fenichel
Copy link
Collaborator

Not finished for RTL

On Tue, Mar 1, 2016 at 12:29 PM Tim Mickel notifications@github.com wrote:

Closed #99 #99.


Reply to this email directly or view it on GitHub
#99 (comment).

@tmickel
Copy link
Contributor Author

tmickel commented Mar 1, 2016

True - considering that separately (#34)

@rachel-fenichel
Copy link
Collaborator

I don't think we should have extremely granular issues open for visuals and then have a single catchall "implement RTL" issue--I think issues should be left open until they are resolved for both ltr and rtl.

picklesrus pushed a commit to picklesrus/scratch-blocks that referenced this pull request Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants