-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Only add a hat if there's no output connection #3280
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with or without the suggested tweak.
core/renderers/common/info.js
Outdated
@@ -266,7 +267,7 @@ Blockly.blockRendering.RenderInfo.prototype.populateTopRow_ = function() { | |||
new Blockly.blockRendering.RoundCorner(this.constants_)); | |||
} | |||
|
|||
if (hasHat) { | |||
if (hasHat && !hasOutputConnection) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would fold the !hasOutputConnection into the definition of hasHat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no prev, no output, and start hat is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually if we want renderers to be able to change this behaviour we probably shouldn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still wrong--the top repeat block should not have a hat. The check is whether there's a previous connection, not whether there's a previous block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, misunderstanding on my part. Updated to only show when there's no previous connection and no output connection.
Why do we want unconnected blocks with previous connections to have a hat? That's still a change in behavior. Edit: What Rachel said. I didn't see her comment when I added this one. |
Yes that’s a misunderstanding on my part of what that property is meant to affect. Will update to only show the start hat if there’s no previous connection and no output connection. |
…evious connection
…google#3280) * Only add a hat if there's no output connection or previous connection
The basics
The details
Resolves
Fixes #3279
Proposed Changes
Only add a hat if there's no output connection
Reason for Changes
Rendering fix.
Test Coverage
Tested on the playground by changing the
Blockly.BlockSvg.START_HAT = true
Tested on:
Documentation
Additional Information