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

Correctly calculate widths of blocks with children on external inputs. #2825

Merged
merged 1 commit into from Aug 15, 2019

Conversation

rachel-fenichel
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

Part of #2821

Proposed Changes

In render_draw_debug:

  • Adds rendering rectangles for the width of a row with connected blocks and the width of a block with connected blocks
  • Adds a config object so it's easy to turn on and off parts of the debug rendering--there's too much going on otherwise.
  • Uses random colours for some parts, to distinguish between blocks at boundaries

In the other three files:

  • Improves calculation of widthWithConnectedBlocks on rows
  • Defines widthWithConnectedBlocks on rows
  • When adding alignment padding to a row, records the size change in widthWithConnectedBlocks (only for external value inputs)

Reason for Changes

Block width was wrong before, and the missing amount was the amount that had been added in alignment padding on the given row (so it was showing up for external value inputs but not otherwise).

Test Coverage

Tested on the playground with the new debug rendering.

Documentation

Description of debug rendering, at some point.

Additional Information

SO MANY COLORED RECTANGLES

this.clearElems();
this.svgRoot_ = block.getSvgRoot();

this.randomColour_ = '#' + Math.floor(Math.random() * 16777215).toString(16);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it

@rachel-fenichel rachel-fenichel merged commit a01d1eb into google:develop Aug 15, 2019
@rachel-fenichel rachel-fenichel deleted the block_widths branch August 15, 2019 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants