Merge pull request #927 from adv-isu/HandlerPathUndoTouchFix2
Improved touch support for Handler.Path.undo
This commit is contained in:
@@ -271,6 +271,16 @@ OpenLayers.Handler.Path = OpenLayers.Class(OpenLayers.Handler.Point, {
|
||||
var target = components[index];
|
||||
var undone = geometry.removeComponent(target);
|
||||
if (undone) {
|
||||
// On touch devices, set the current ("mouse location") point to
|
||||
// match the last digitized point.
|
||||
if (this.touch && index > 0) {
|
||||
components = geometry.components; // safety
|
||||
var lastpt = components[index - 1];
|
||||
var curptidx = this.getCurrentPointIndex();
|
||||
var curpt = components[curptidx];
|
||||
curpt.x = lastpt.x;
|
||||
curpt.y = lastpt.y;
|
||||
}
|
||||
if (!this.redoStack) {
|
||||
this.redoStack = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user