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

Resolve field angle overlap render problem #2418

Merged
merged 5 commits into from
May 2, 2019
Merged

Conversation

nhzandi
Copy link
Contributor

@nhzandi nhzandi commented Apr 28, 2019

The basics

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

The details

Resolves

Adding a border to angle picker field, to fix rendering problem when two blocks with the same color overlap issue #2379

Proposed Changes

Instead of using the same color for background and border, lighten the background color and use it for border color.
after_change
after_change2

Reason for Changes

Some render problems when two blocks with the same color overlap. issue #2379

before_change

Test Coverage

Tested on:

  • Desktop Chrome
  • Desktop Firefox

Additional Information

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@nhzandi nhzandi changed the base branch from master to develop April 28, 2019 13:47
@nhzandi nhzandi changed the base branch from develop to master April 28, 2019 13:48
@nhzandi
Copy link
Contributor Author

nhzandi commented Apr 28, 2019

I signed it!

@BeksOmega
Copy link
Collaborator

Note to maintainers: I added some colour calculation functions in #2413 that may affect this.

@RoboErikG
Copy link
Contributor

Hi Navid,

Thanks for the contribution, but we only accept pull requests against the develop branch. You may be able to rebase your branch locally (git rebase develop) or create a new branch based on develop and cherry-pick your change onto it.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@nhzandi nhzandi changed the base branch from master to develop May 1, 2019 14:07
@nhzandi
Copy link
Contributor Author

nhzandi commented May 1, 2019

@RoboErikG My mistake. It is now against the develop branch

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@@ -209,7 +210,7 @@ Blockly.FieldAngle.prototype.showEditor_ = function() {


Blockly.DropDownDiv.setColour(this.sourceBlock_.getColour(),
this.sourceBlock_.getColour());
goog.color.rgbArrayToHex(goog.color.lighten(goog.color.hexToRgb(this.sourceBlock_.getColour()), 0.6)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Bonus, BeksOmega just added an API for this. You can now use block.getColourBorder().

The one caveat is you need to check which border colour to use since the old style is slightly different. We might tweak the API with this use case in mind, but for now this can be:

var border = this.sourceBlock_.getColourBorder();
border = border.colourBorder == null ? border.colourLight : border.colourBorder;

Blockly.DropDownDiv.setColour(this.sourceBlock_.getColour(), border);

@RoboErikG
Copy link
Contributor

@BeksOmega no action necessary, but as a point of reference here's another use case for the colourBorder API. =)

@RoboErikG RoboErikG merged commit 44501f1 into google:develop May 2, 2019
@RoboErikG
Copy link
Contributor

Thanks for the PR!

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

5 participants