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

Fix cursor rendering #2932

Merged
merged 5 commits into from
Aug 29, 2019
Merged

Conversation

alschmiedt
Copy link
Contributor

The basics

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

The details

Resolves

The cursor should always be shown on top of the marker so that it does not disappear when a user marks a connection.

Proposed Changes

Update the position of the marker and the cursor in the dom so that the cursor is always after the marker.

Reason for Changes

Test Coverage

Tested on:

Documentation

Additional Information

newParent.appendChild(svgRoot);
if (this.isMarker_) {
for (var i = 0, childNode; childNode = newParent.childNodes[i]; i++) {
if (childNode.className.baseVal == Blockly.CursorSvg.CURSOR_CLASS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Blockly.utils.dom.hasClass(childNode , Blockly.CursorSvg.CURSOR_CLASS)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

}
newParent.insertBefore(svgRoot, cursorNode);
} else {
newParent.appendChild(svgRoot);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify, is this just trying to make sure that the marker cursor comes before the cursor cursor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, otherwise the marker will cover the cursor and you won't be able to see it.

Copy link
Contributor

@samelhusseini samelhusseini left a comment

Choose a reason for hiding this comment

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

lgtm

@alschmiedt alschmiedt merged commit 72d73f7 into google:develop Aug 29, 2019
@alschmiedt alschmiedt deleted the fix_cursor_rendering branch May 29, 2020 15:33
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.

2 participants