SR use case insensitive when checking wireframe background color opacity#1223
Merged
mariusc83 merged 1 commit intoJan 10, 2023
Merged
Conversation
0xnm
reviewed
Jan 9, 2023
| return this.opacity == FULL_OPACITY_ALPHA && | ||
| this.backgroundColor != null && | ||
| this.backgroundColor.takeLast(2) == FULL_OPACITY_ALPHA_AS_HEXA_STRING | ||
| this.backgroundColor.takeLast(2).matches(FULL_OPACITY_REG_EX) |
Member
There was a problem hiding this comment.
probably we don't need regex here, we can just convert to upper/lowecase and compare?
Member
Author
There was a problem hiding this comment.
yes was not sure which one is better but I think conversion is faster. I will do that.
Codecov Report
@@ Coverage Diff @@
## feature/sdkv2 #1223 +/- ##
=================================================
+ Coverage 82.72% 82.76% +0.04%
=================================================
Files 353 354 +1
Lines 12589 12590 +1
Branches 2086 2088 +2
=================================================
+ Hits 10414 10420 +6
+ Misses 1535 1530 -5
Partials 640 640
|
mariusc83
force-pushed
the
mconstantin/fix-translucent-color-verification
branch
from
January 9, 2023 13:21
c0c2ad6 to
1789cee
Compare
0xnm
approved these changes
Jan 9, 2023
| return this.opacity == FULL_OPACITY_ALPHA && | ||
| this.backgroundColor != null && | ||
| this.backgroundColor.takeLast(2) == FULL_OPACITY_ALPHA_AS_HEXA_STRING | ||
| this.backgroundColor.takeLast(2).lowercase() == FULL_OPACITY_STRING_HEXA |
Member
There was a problem hiding this comment.
Suggested change
| this.backgroundColor.takeLast(2).lowercase() == FULL_OPACITY_STRING_HEXA | |
| this.backgroundColor.takeLast(2).lowercase(Locale.US) == FULL_OPACITY_STRING_HEXA |
Member
Author
There was a problem hiding this comment.
Oh the default is the ROOT meaning the project locale....damn
|
|
||
| companion object { | ||
| const val FULL_OPACITY_ALPHA_AS_HEXA_STRING = "FF" | ||
| val FULL_OPACITY_STRING_HEXA = "ff" |
Member
There was a problem hiding this comment.
Suggested change
| val FULL_OPACITY_STRING_HEXA = "ff" | |
| const val FULL_OPACITY_STRING_HEXA = "ff" |
mariusc83
force-pushed
the
mconstantin/fix-translucent-color-verification
branch
from
January 9, 2023 13:27
1789cee to
c226a55
Compare
xgouchet
approved these changes
Jan 9, 2023
mariusc83
force-pushed
the
mconstantin/fix-translucent-color-verification
branch
from
January 10, 2023 08:55
c226a55 to
2f7ddb1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
We were using assuming that the Wireframe
backgroundColorwill always be reported in capital letters when checking for its opacity. This was buggy and in this PR we are fixing this by using a case insensitiveRegExinstead.Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)