【发布时间】:2011-01-22 17:58:39
【问题描述】:
我想知道{Shape}.attr("fill","url({image.path})") 的行为。
将填充图像应用于形状时:
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')"); // <--
...
}
}
背景图像似乎在形状后面的画布上出现了青色,因此位置变得奇怪(附上插图快照 - 我将原始图像边框标记为红色)。
这似乎在沿路径存在动画时自行解决(仅path.M(0,0) 就足够了)。
首先如何正确定位填充图像?
【问题讨论】:
标签: gwt raphael vector-graphics