From e909fc01c0554d3e7dbe91dfec35d48a465f18ee Mon Sep 17 00:00:00 2001 From: Jonathan Lawlor Date: Fri, 21 Oct 2016 10:22:33 -0700 Subject: [PATCH] Fix path effect styling in nodes workflow Summary: From task: in Nodes today, styles (dashed and dotted) only work on borders if the view has rounded corners. this is incorrect as they should work even when we're drawing rectangular borders. Looking at the current non-nodes code (https://fburl.com/474407319) we can see that whenever there is a pathstyle effect the non-nodes code treats the border as if it was rounded (note that mBorderStyle == null || mBorderStyle == BorderStyle.SOLID means NO path effect is applied). To bring the Nodes code in line with the non-Nodes code we can simply do the same thing: if there is a path style effect draw it as if it was rounded. Reviewed By: ahmedre Differential Revision: D4054722 --- .../src/main/java/com/facebook/react/flat/DrawBorder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java b/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java index a2d0bd14e..73eec053b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/DrawBorder.java @@ -172,7 +172,7 @@ import com.facebook.csslayout.Spacing; @Override protected void onDraw(Canvas canvas) { - if (getBorderRadius() >= 0.5f) { + if (getBorderRadius() >= 0.5f || getPathEffectForBorderStyle() != null) { drawRoundedBorders(canvas); } else { drawRectangularBorders(canvas);