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.
|
// 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.
|
// 'force' argument is passed when leaving drawing mode to ensure all is clean, as a workaround for possible bugs.
|
||||||
_stopAll: function(force) {
|
_stopAll: function(force) {
|
||||||
if (this.grabbedElement)
|
if (this.grabbedElement) {
|
||||||
this._stopTransforming();
|
this._stopTransforming();
|
||||||
|
this.grabbedElement = null;
|
||||||
|
this.grabbedElementLocked = null;
|
||||||
|
this.updatePointerCursor();
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.currentElement && !force)
|
if (!this.currentElement && !force)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -577,11 +577,12 @@ const _DrawingElement = new Lang.Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
stopTransformation: function() {
|
stopTransformation: function() {
|
||||||
|
this.showSymmetryElement = false;
|
||||||
|
|
||||||
// Clean transformations
|
// Clean transformations
|
||||||
let transformation = this.lastTransformation;
|
let transformation = this.lastTransformation;
|
||||||
|
if (!transformation)
|
||||||
if (transformation.type == Transformations.REFLECTION || transformation.type == Transformations.INVERSION)
|
return;
|
||||||
this.showSymmetryElement = false;
|
|
||||||
|
|
||||||
if (transformation.type == Transformations.REFLECTION &&
|
if (transformation.type == Transformations.REFLECTION &&
|
||||||
getNearness([transformation.startX, transformation.startY], [transformation.endX, transformation.endY], MIN_REFLECTION_LINE_LENGTH) ||
|
getNearness([transformation.startX, transformation.startY], [transformation.endX, transformation.endY], MIN_REFLECTION_LINE_LENGTH) ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue