|
目前有个这样的需求:根据实际占比来填充圆,下面是用Canvas画的两个半圆:
代码:
Canvas{ id:canvas width:parent.width height: parent.height onPaint: { var cans = canvas.getContext("2d"); cans.beginPath(); cans.translate(testRect.x+testRect.width/2,testRect.y+testRect.width/2) cans.arc(0,0,(testRect.width/2)-10,0,0.6*360*(Math.PI/180),0); cans.fillStyle = "blue" cans.closePath(); cans.fill(); } }
问题:要把60%的也像50%的一样水平,需要旋转的算法是什么?
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|