Pixplicity / sharp

Scalable vector graphics for Android
Apache License 2.0
1.03k stars 117 forks source link

Add support for stroke-dasharray #46

Closed vlad-roid closed 4 years ago

vlad-roid commented 5 years ago

Currently stroke-dasharray isn't supported. It would make sense to add it inside the doStroke method like this:

                String dashArray = atts.getString("stroke-dasharray");
                if (dashArray != null && !dashArray.equalsIgnoreCase("none")) {
                    String[] splitDashArray = dashArray.split(", ?");
                    float[] intervals = new float[splitDashArray.length];
                    for (int i = 0; i < splitDashArray.length; i++) {
                        intervals[i] = Float.parseFloat(splitDashArray[i]);
                    }
                    mStrokePaint.setPathEffect(new DashPathEffect(intervals, 0));
                }
pflammertsma commented 4 years ago

I believe this was resolved in PR #52; see 13ab3172e8bc08c03e29fd18e3e3802174263728