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

Fixes bumping too much when in RTL #2360

Merged
merged 1 commit into from
Apr 4, 2019
Merged

Conversation

alschmiedt
Copy link
Contributor

@alschmiedt alschmiedt commented Apr 4, 2019

The basics

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

The details

Resolves

#2290

Proposed Changes

Previously we were just taking the negative value of dx when in RTL. As far as I can tell this only works the first time that we bump a block. The next times that we bump a block the x value of the output connection is farther to the left(because of the previous bump) while the place that we want to get to (staticConnection.x_ + snap_radius + random number) is moving farther to the right. So when we take the different between the two it is getting larger and larger creating the unnecessarily large bump.

The proposed fix is to change subtract the snap_radius and random number instead of adding them. This way our target is in the same direction as the block is moving. Which will create a smaller bump.

Reason for Changes

Some blocks in RTL were getting bumped too far.

Test Coverage

Tested on:
Desktop Chrome

Additional Information

@alschmiedt alschmiedt merged commit dcbac91 into google:develop Apr 4, 2019
@alschmiedt alschmiedt deleted the Bump_RTL branch October 23, 2020 16:38
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