Skip to content
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

Brush Round #2

Open
NickNish09 opened this issue May 28, 2019 · 2 comments
Open

Brush Round #2

NickNish09 opened this issue May 28, 2019 · 2 comments

Comments

@NickNish09
Copy link

Is there a way to make the brush pattern round? Or change it to be something different than the normal rectangle?

@DiegoMac95
Copy link

@NickNish09 did you find a way to change it?

@sumitsk1
Copy link

--- a/node_modules/react-native-scratch/android/src/main/java/com/reactlibrary/ScratchView.java
+++ b/node_modules/react-native-scratch/android/src/main/java/com/reactlibrary/ScratchView.java
@@ -76,7 +76,10 @@ public class ScratchView extends View implements View.OnTouchListener {
         pathPaint.setStyle(Paint.Style.STROKE);
         pathPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
         pathPaint.setAntiAlias(true);
-
+        pathPaint.setDither(true);                    // set the dither to true
+        pathPaint.setStyle(Paint.Style.STROKE);       // set to STOKE
+        pathPaint.setStrokeJoin(Paint.Join.ROUND);    // set the join to round you want
+        pathPaint.setStrokeCap(Paint.Cap.ROUND);      // set the paint cap to round too
         setLayerType(View.LAYER_TYPE_SOFTWARE, null);
     }

patch-package diff for round brush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants