1
我想知道{Shape}.attr("fill","url({image.path})")
的行爲。Raphael-GWT:填充圖像的形狀(Rect)出現偏移。如何解決這個問題?
施加填充圖像的形狀時:
public class AppMapCanvas extends Raphael {
public AppMapCanvas(int width, int height) {
super(width, height);
this.hCenter = width/2;
this.vCenter = height/2;
...
Rect rect = this.new Rect(hCenter, vCenter, 144, 40, 4);
rect.attr("fill", "url('../images/app-module-1-bg.png')"); // <--
...
}
}
背景圖像似乎TEAL翻過形狀背後的畫布,從而會很奇怪定位(圖示快照被封閉 - I標記的原始圖像的邊界紅色的)。
這似乎解決本身在動畫中的存在沿着路徑(僅path.M(0,0)
是sufficiant)。
如何正確定位填充圖像?
Raphaël確實使用``元素來填充圖片,請參閱https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael.js。 –
2012-03-23 12:30:33