9
我想用CanvasRenderingContext2D.prototype創建一個arrowTo函數。要做到這一點,我需要獲取最後一點的座標。例如獲取畫布上下文的最後一個座標
//...
var ctx = someCanvas.getContext('2d');
ctx.moveTo(10,40);
//the coordinates of the last point are now (10,40)
ctx.lineTo(50,50);
//and now it's (50,50)
//...
我該如何檢索它們?
只要將它們存儲在一個變量中,只要你畫? – ide 2011-02-28 21:25:57
複製[查找HTML Canvas上下文路徑上的當前點?](http://stackoverflow.com/questions/4577410/find-current-point-on-path-for-html-canvas-context);我希望這是可能的,但它不是沒有包裝在一個跟蹤這個包裝的畫布上下文。 – Phrogz 2011-02-28 23:18:31
請參閱https://bugzilla.mozilla.org/show_bug.cgi?id=644633 – 2013-03-15 15:36:59