fix transformation stopping
* Handle case where grabbed element does not have transformation to stop. * Update cursor after erasing drawing while an element is grabbed.
This commit is contained in:
parent
44ba9ba17d
commit
ed167f8d1b
6
area.js
6
area.js
|
|
@ -884,8 +884,12 @@ var DrawingArea = new Lang.Class({
|
|||
// A priori there is nothing to stop, except transformations, if there is no current element.
|
||||
// 'force' argument is passed when leaving drawing mode to ensure all is clean, as a workaround for possible bugs.
|
||||
_stopAll: function(force) {
|
||||
if (this.grabbedElement)
|
||||
if (this.grabbedElement) {
|
||||
this._stopTransforming();
|
||||
this.grabbedElement = null;
|
||||
this.grabbedElementLocked = null;
|
||||
this.updatePointerCursor();
|
||||
}
|
||||
|
||||
if (!this.currentElement && !force)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -577,11 +577,12 @@ const _DrawingElement = new Lang.Class({
|
|||
},
|
||||
|
||||
stopTransformation: function() {
|
||||
this.showSymmetryElement = false;
|
||||
|
||||
// Clean transformations
|
||||
let transformation = this.lastTransformation;
|
||||
|
||||
if (transformation.type == Transformations.REFLECTION || transformation.type == Transformations.INVERSION)
|
||||
this.showSymmetryElement = false;
|
||||
if (!transformation)
|
||||
return;
|
||||
|
||||
if (transformation.type == Transformations.REFLECTION &&
|
||||
getNearness([transformation.startX, transformation.startY], [transformation.endX, transformation.endY], MIN_REFLECTION_LINE_LENGTH) ||
|
||||
|
|
|
|||
Loading…
Reference in New Issue