dont use ios border rendering if we use default black color

Summary:
iOS and css have a different way to draw borders. Decision which rendering to use considers alpha value of given color as well.
If alpha=0 -> border is invisible -> we use ios render.
That doesn't work as expected in a case where only `borderWidth` property is set.
A default black color is used when no `borderColor` is set, but alpha checking logic will test `null`. Which resolves as alpha=0.

Reviewed By: javache

Differential Revision: D3750523

fbshipit-source-id: 453d52a16287c6286e8887a9ab3795d3ded1dec6
This commit is contained in:
Martin Kralik 2016-08-23 03:43:31 -07:00 committed by Facebook Github Bot 5
parent 107fc72dab
commit a6868161cb
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:unused)
// the content. For this reason, only use iOS border drawing when clipping
// or when the border is hidden.
(borderInsets.top == 0 || CGColorGetAlpha(borderColors.top) == 0 || self.clipsToBounds);
(borderInsets.top == 0 || (borderColors.top && CGColorGetAlpha(borderColors.top) == 0) || self.clipsToBounds);
// iOS clips to the outside of the border, but CSS clips to the inside. To
// solve this, we'll need to add a container view inside the main view to