mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix border-stroke drawing after resetting border-radius (#28356)
Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:**  **After the fix:**  Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6694ce00bb
commit
7757ad0576
+2
-1
@@ -998,10 +998,11 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
||||
}
|
||||
|
||||
private void drawRectangularBackgroundWithBorders(Canvas canvas) {
|
||||
mPaint.setStyle(Paint.Style.FILL);
|
||||
|
||||
int useColor = ColorUtil.multiplyColorAlpha(mColor, mAlpha);
|
||||
if (Color.alpha(useColor) != 0) { // color is not transparent
|
||||
mPaint.setColor(useColor);
|
||||
mPaint.setStyle(Paint.Style.FILL);
|
||||
canvas.drawRect(getBounds(), mPaint);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user