-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
add the ability to create triangles using css tricks #5911
Conversation
hyugit
commented
Feb 13, 2016
- modify ReactViewBackgroundDrawable.java to make each border a trapezoid
- disable anti-alias to eliminate white spaces between borders
- add examples to BorderExample.js (see last one)
- modify ReactViewBackgroundDrawable.java to make each border a trapezoid - disable anti-alias to eliminate white spaces between borders - add examples to BorderExample.js (see last one)
By analyzing the blame information on this pull request, we identified @mkonicek, @nicklockwood and @a2 to be potential reviewers. |
- modify ReactViewBackgroundDrawable.java to make each border a trapezoid - disable anti-alias to eliminate white spaces between borders - add examples to BorderExample.js (see last one)
The screenshots above are from UIExplorer - BorderExample page |
Does the example also work on iOS? |
Theoretically yes: |
Cool, well I'm happy with this then. I'm not really qualified to review the Java code though. Maybe @dmmiller can weigh in? |
So cool! |
if (borderLeft > 0 && colorLeft != Color.TRANSPARENT) { | ||
mPaint.setColor(colorLeft); | ||
canvas.drawRect(0, borderTop, borderLeft, height - borderBottom, mPaint); | ||
Path leftBorderPath = new Path(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of allocating a new Path() each time, can you reset() and reuse? Generally better to avoid allocations while drawing.
- modify ReactViewBackgroundDrawable.java to make each border a trapezoid - disable anti-alias to eliminate white spaces between borders - add examples to BorderExample.js (see last one)
@trave7er updated the pull request. |
@trave7er updated the pull request. |
@trave7er updated the pull request. |
|
||
mPaint.setAntiAlias(false); | ||
|
||
Path borderPath = new Path(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just allocate this once up in the constructor and reset it each time it is used?
@trave7er updated the pull request. |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
a6a4389
Summary:- modify ReactViewBackgroundDrawable.java to make each border a trapezoid - disable anti-alias to eliminate white spaces between borders - add examples to BorderExample.js (see last one) Closes facebook#5911 Differential Revision: D2953734 Pulled By: dmmiller fb-gh-sync-id: dd103d80dec53ad35c9539ab1ceb93ef857feeb9 shipit-source-id: dd103d80dec53ad35c9539ab1ceb93ef857feeb9
Summary:- modify ReactViewBackgroundDrawable.java to make each border a trapezoid - disable anti-alias to eliminate white spaces between borders - add examples to BorderExample.js (see last one) Closes facebook#5911 Differential Revision: D2953734 Pulled By: dmmiller fb-gh-sync-id: dd103d80dec53ad35c9539ab1ceb93ef857feeb9 shipit-source-id: dd103d80dec53ad35c9539ab1ceb93ef857feeb9