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

Always use ConstantProvider.shapeFor() for rendering notches #3522

Closed
radovan76 opened this issue Dec 18, 2019 · 0 comments
Closed

Always use ConstantProvider.shapeFor() for rendering notches #3522

radovan76 opened this issue Dec 18, 2019 · 0 comments
Assignees
Labels
component: rendering issue: feature request Describes a new feature and why it should be added

Comments

@radovan76
Copy link

radovan76 commented Dec 18, 2019

Is your feature request related to a problem? Please describe.
I have different notches for different connection types in my project.
It can be managed in ConstantProvider.shapeFor() method. But sometimes is NOTCH path accessed directly and shape will not render correctly.

Describe the solution you'd like
Change all occurences of accessing NOTCH to calling ConstantProvider.shapeFor() method.

Additional context
Where to change it:
change row in Blockly.geras.Highlighter.prototype.drawTopCorner method in core/renderers/geras/highliter.js:
this.steps_ += this.notchPaths_.pathLeft;
to:
this.steps_ += row.constants_.shapeFor(row.connection.connectionModel).pathLeft;

change row in Blockly.RenderedConnection.prototype.highlight method in core/rendered_connection.js:
renderingConstants.NOTCH.pathLeft +
to:
renderingConstants.shapeFor(this).pathLeft +

in core/keyboard_nav/cursor_svg.js:
change row in Blockly.CursorSvg.prototype.showWithBlockPrevOutput_ method
this.positionPrevious_(width, cursorOffset, cursorHeight);
to:
this.positionPrevious_(width, cursorOffset, cursorHeight,block.previousConnection);

add parameter connection into Blockly.CursorSvg.prototype.positionPrevious_ method
and change row:
this.constants_.NOTCH.pathLeft +
to:
connection?this.constants_.shapeFor(connection).pathLeft:this.constants_.NOTCH.pathLeft +

After these code changes is custom notch rendered correctly.

@radovan76 radovan76 added issue: triage Issues awaiting triage by a Blockly team member issue: feature request Describes a new feature and why it should be added labels Dec 18, 2019
@rachel-fenichel rachel-fenichel added this to the 2019_q4_release milestone Dec 18, 2019
@moniika moniika added component: rendering and removed issue: triage Issues awaiting triage by a Blockly team member labels Jan 6, 2020
@moniika moniika self-assigned this Jan 6, 2020
@moniika moniika closed this as completed Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: rendering issue: feature request Describes a new feature and why it should be added
Projects
None yet
Development

No branches or pull requests

3 participants