Thursday, September 10, 2015

Android Memory Compact Draw Segments drawLines();

if (count >= 4) {
    if ((count & 2) != 0) {
        canvas.drawLines(pointlist, 0, count-2, linePaint);
        canvas.drawLines(pointlist, 2, count-2, linePaint);
    }
    else {
        canvas.drawLines(pointlist, 0, count, linePaint);
        canvas.drawLines(pointlist, 2, count - 4, linePaint);
    }
}

If anybody needs to draw a bunch of lines from a float[] of points (not segments). Somebody is going to go OMG that's way better than how I was doing it!

No comments: