Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27d1916e authored by Jim Miller's avatar Jim Miller Committed by Android Git Automerger
Browse files

am fce2ec4d: Merge "Fix 6656710: center dot pattern in GlowPadView" into jb-dev

* commit 'fce2ec4d':
  Fix 6656710: center dot pattern in GlowPadView
parents 58a8d8d2 fce2ec4d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -202,25 +202,25 @@ public class PointCloud {

    public void draw(Canvas canvas) {
        ArrayList<Point> points = mPointCloud;
        final float cx = mDrawable != null ? (-mDrawable.getIntrinsicWidth() / 2) : 0;
        final float cy = mDrawable != null ? (-mDrawable.getIntrinsicHeight() / 2) : 0;
        canvas.save(Canvas.MATRIX_SAVE_FLAG);
        canvas.scale(mScale, mScale, mCenterX, mCenterY);
        for (int i = 0; i < points.size(); i++) {
            Point point = points.get(i);
            final float pointSize = interp(MAX_POINT_SIZE, MIN_POINT_SIZE,
                    point.radius / mOuterRadius);
            final float px = point.x + cx + mCenterX;
            final float py = point.y + cy + mCenterY;
            final float px = point.x + mCenterX;
            final float py = point.y + mCenterY;
            int alpha = getAlphaForPoint(point);

            if (alpha == 0) continue;

            if (mDrawable != null) {
                canvas.save(Canvas.MATRIX_SAVE_FLAG);
                float s = pointSize / MAX_POINT_SIZE;
                final float cx = mDrawable.getIntrinsicWidth() * 0.5f;
                final float cy = mDrawable.getIntrinsicHeight() * 0.5f;
                final float s = pointSize / MAX_POINT_SIZE;
                canvas.scale(s, s, px, py);
                canvas.translate(px, py);
                canvas.translate(px - cx, py - cy);
                mDrawable.setAlpha(alpha);
                mDrawable.draw(canvas);
                canvas.restore();