RoundRectangle看起来很紧张

时间:2014-07-03 21:30:58

标签: java android

我正在尝试在屏幕上渲染一个圆形矩形,但它看起来好像被拉伸了。

private void init(){
            mOuterRect = new RectF(0.0f,0.0f,1.0f,1.0f);
            //other stuff
}

@Override
protected void onDraw(final Canvas canvas) {


            canvas.scale(getWidth(), getHeight());

            drawRect(canvas);

        }

private void drawRect(Canvas canvas) {

        float radius = 0.05f;


        canvas.drawRoundRect(mOuterRect, radius,radius, mOuterRectPaint);



    }

我认为它与缩放有关,我试图解决这个问题,但结果更糟。是什么导致图像像这样被拉伸?

enter image description here

0 个答案:

没有答案