attribute width height:
canvas的宽高,在canvas上定位坐标等,是依据此宽高。
style width height :绘制的宽高,如果与上面宽高不等比,会出现拉伸压缩情况。可以理解为,style是对attribute进行了缩放操作。style是在屏幕上显示的大小。
attribute width height:
canvas的宽高,在canvas上定位坐标等,是依据此宽高。
style width height :绘制的宽高,如果与上面宽高不等比,会出现拉伸压缩情况。可以理解为,style是对attribute进行了缩放操作。style是在屏幕上显示的大小。