我遵循此示例:http://www.html5canvastutorials.com/labs/html5-canvas-modify-shape-color-on-click/爲了改變我的形狀在鼠標操作上的顏色。當設置填充時添加額外'嘈雜'像素
一切正常有關設置顏色,但看到例如:
我有一條藍線。當我將它翻譯爲紅色時,線條邊界上會保留一些藍色像素。當我回到藍色時,仍有一些紅色像素。
我的代碼如下:
recolor: function(newColor){
// Children are Kinetic.rect or Kinetic.line
var children=this.group.children;
for(var k in children){
if(children[k] instanceof Kinetic.Line)
children[k].setStroke(newColor);
else
children[k].setFill(newColor);
}
this.group.draw();
}
下面是截圖(正常和縮放):
你有沒有在不同的瀏覽器中試過這個? – SoluableNonagon 2013-04-23 18:23:50
是的,鉻和火狐。每個最新的 – 2013-04-23 18:32:17