GithubHelp home page GithubHelp logo

android6_bug_in_android.graphics.path's Introduction

android.graphics.Path working wrong on Android 6.0

Some Path displayed wrong on android 6.0 but on android 4.1 (and othes) all correct.

If stroke width > 1 then Path displayed incorrect.

On Android 6.0 and Android 4.1

Android 6.0 Android 4.1

Full code for test

package ru.lazard.myapplication;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new MyView(this));
    }

    public class MyView extends View {
        private final Paint mPaint;
        private final Path mPath;

        public MyView(Context context) {
            super(context);

            mPaint = new Paint();
            mPaint.setStrokeWidth(40);
            mPaint.setStyle(Paint.Style.STROKE);

            mPath = new Path();
            mPath.moveTo(77.35896f, 60.400444f);
            mPath.cubicTo(77.35896f, 60.400444f, 79.225426f, 29.841496f, 45.79181f, 26.622204f);
            mPath.cubicTo(17.59754f, 23.541723f, 12.924118f, 48.732895f, 12.924118f, 48.732895f);
            mPath.cubicTo(5.9657674f, 87.16086f, 64.28567f, 132.59851f, 64.28567f, 132.59851f);
            mPath.cubicTo(64.28567f, 132.59851f, 134.76442f, 110.88812f, 141.79378f, 72.06799f);
            mPath.cubicTo(141.79378f, 72.06799f, 146.64627f, 46.909233f, 118.7662f, 39.836056f);
            mPath.cubicTo(87.89501f, 31.411335f, 77.35896f, 60.400436f, 77.35896f, 60.400436f);
            mPath.close();

        }

        @Override
        protected void onDraw(Canvas canvas) {
            canvas.translate(50,50);
            canvas.drawPath(mPath, mPaint);
        }
    }


}

android6_bug_in_android.graphics.path's People

Contributors

tepikin avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.