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

Changes the cursor look for a stack #2452

Merged
merged 6 commits into from
May 8, 2019

Conversation

alschmiedt
Copy link
Contributor

@alschmiedt alschmiedt commented May 8, 2019

The basics

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

The details

Resolves

Having the cursor for a stack and a block be the same can be pretty confusing when trying to navigate through the blocks.

Proposed Changes

Make the cursor for a stack cover the entire stack of blocks as well as make it slightly cover a slightly larger area than the block.

Reason for Changes

Test Coverage

Tested on:

Additional Information

Screen Shot 2019-05-08 at 2 44 31 PM

Blockly.CursorSvg.prototype.showWithStack_ = function() {
var block = this.getCurNode().getLocation();

//Gets the height and width of entire stack
Copy link
Collaborator

Choose a reason for hiding this comment

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

General formatting comment: single line comments should have a space after the second slash, and a period at the end. As usual for this sort of stuff, apply it to the lines you touched here and change existing ones as you touch them in other PRs.


//If the block has an output connection it needs more padding
if (block.outputConnection) {
x = -1 * Blockly.CursorSvg.STACK_PADDING;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be x -= Blockly.BlockSvg.TAB_WIDTH; and do you need to add the tab width to the cursor width or is it calculated in the block's width but drawn with a - offset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes to the first part, but I think the TAB_WIDTH is included when we get the width for the entire block so we just need to change where it is positioned.

@alschmiedt alschmiedt merged commit 2a9fea4 into google:keyboard_nav May 8, 2019
@alschmiedt alschmiedt deleted the stack_cursor branch May 29, 2020 15:36
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

3 participants