新版本plus库使用setClipPath( )设置了圆角矩形的裁剪区,然后再通过graphics.fillRectangle( )填充矩形,达到圆角矩形的效果。
这样的缺点是,圆角处有明显的锯齿,这是由path的圆角弧线造成的,因为这个裁剪区不是平滑的。
这个裁剪区还有其他作用,我没仔细研究怎样完美解决他,暂且提供一种用plus当做按钮时的应急方法:
1、取消这个clip,注释掉以下代码(第230行):
/**
if( this.border[["radius"]] && this.border[["radius"]] > 0 ){
var path = ..gdip.path(1/*_FillModeWinding*/)
path.addRoundRect(rc,this.border.radius*dpiScaleX);
graphics.setClipPath(path,1/*_CombineModeIntersect*/);
}
**/2、后面紧跟着的两处填充矩形,改为填充圆角矩形:
graphics.fillRectangle( brush,$left,$top,$width,$height);
改为:
graphics.fillRoundRect( brush,$left,$top,$width,$height,(this.border[["radius"]]:0)*dpiScaleX);
注意:这样改(取消了裁剪区)肯定影响plus的其他图形绘制效果,我没详细测试,所以只限圆角矩形按钮应急使用。