Revert D7569885: Fix anti aliasing rounded background
Differential Revision: D7569885 Original commit changeset: 4bfb00485211 fbshipit-source-id: 2fc76ca8615d5562ebe8c7527e9a54058b8d82dc
This commit is contained in:
parent
1433d15557
commit
e4f88c66e3
|
@ -343,23 +343,6 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
||||||
|| borderWidth.bottom > 0
|
|| borderWidth.bottom > 0
|
||||||
|| borderWidth.left > 0
|
|| borderWidth.left > 0
|
||||||
|| borderWidth.right > 0) {
|
|| borderWidth.right > 0) {
|
||||||
|
|
||||||
//If it's a full and even border draw inner rect path with stroke
|
|
||||||
final float fullBorderWidth = getFullBorderWidth();
|
|
||||||
if (borderWidth.top == fullBorderWidth &&
|
|
||||||
borderWidth.bottom == fullBorderWidth &&
|
|
||||||
borderWidth.left == fullBorderWidth &&
|
|
||||||
borderWidth.right == fullBorderWidth) {
|
|
||||||
if (fullBorderWidth > 0) {
|
|
||||||
int borderColor = getBorderColor(Spacing.ALL);
|
|
||||||
mPaint.setColor(ColorUtil.multiplyColorAlpha(borderColor, mAlpha));
|
|
||||||
mPaint.setStyle(Paint.Style.STROKE);
|
|
||||||
mPaint.setStrokeWidth(fullBorderWidth);
|
|
||||||
canvas.drawPath(mInnerClipPathForBorderRadius, mPaint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//In the case of uneven border widths/colors draw quadrilateral in each direction
|
|
||||||
else {
|
|
||||||
mPaint.setStyle(Paint.Style.FILL);
|
mPaint.setStyle(Paint.Style.FILL);
|
||||||
|
|
||||||
// Draw border
|
// Draw border
|
||||||
|
@ -396,10 +379,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
||||||
|
|
||||||
final boolean isColorStartDefined = isBorderColorDefined(Spacing.START);
|
final boolean isColorStartDefined = isBorderColorDefined(Spacing.START);
|
||||||
final boolean isColorEndDefined = isBorderColorDefined(Spacing.END);
|
final boolean isColorEndDefined = isBorderColorDefined(Spacing.END);
|
||||||
final boolean isDirectionAwareColorLeftDefined =
|
final boolean isDirectionAwareColorLeftDefined = isRTL ? isColorEndDefined : isColorStartDefined;
|
||||||
isRTL ? isColorEndDefined : isColorStartDefined;
|
final boolean isDirectionAwareColorRightDefined = isRTL ? isColorStartDefined : isColorEndDefined;
|
||||||
final boolean isDirectionAwareColorRightDefined =
|
|
||||||
isRTL ? isColorStartDefined : isColorEndDefined;
|
|
||||||
|
|
||||||
if (isDirectionAwareColorLeftDefined) {
|
if (isDirectionAwareColorLeftDefined) {
|
||||||
colorLeft = directionAwareColorLeft;
|
colorLeft = directionAwareColorLeft;
|
||||||
|
@ -468,7 +449,7 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
||||||
drawQuadrilateral(canvas, colorBottom, x1, y1, x2, y2, x3, y3, x4, y4);
|
drawQuadrilateral(canvas, colorBottom, x1, y1, x2, y2, x3, y3, x4, y4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue