You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is not possible to delete all areas: in the function requestDelete around line 2350 there is a check on "this.ui.multi.length > 1". I can delete areas if there are two or more left, but never the last one. However it can be nice to be able to delete all areas and allow the user to start with a clean image.
I am not too familiar with this plugin so I changed the above check to "this.ui.multi.length > 0" and then I changed the function deleteSelection to :
deleteSelection: function () {
if (this.ui.selection) {
this.removeSelection(this.ui.selection);
if (this.ui.multi[0]) {
this.ui.multi[0].focus();
} else {
var max = this.getContainerSize();
var selection = {
w: max[0],
x: 0,
x2: max[0],
h: max[1],
y: 0,
y2: max[1]
}
this.ui.selection.redraw(selection);
}
this.ui.selection.refresh();
}
}
Probably a clumsy solution but maybe it will help you with a clean solution. Thanks in advance :)
The text was updated successfully, but these errors were encountered:
It's intentional that you can't delete the last one (hence requestDelete()).
In 0.9.x versions, there was a sense of "selected" or nothing selected.
In 2.x versions, (ideally) it's intended that something is selected at all times.
Below references newest version of WIP-2.x branch
If you wanted to do this, a better workaround is to add a new API method.
(Re-write or polyfill the forEach method if your environment doesn't support it.)
Currently it is not possible to delete all areas: in the function requestDelete around line 2350 there is a check on "this.ui.multi.length > 1". I can delete areas if there are two or more left, but never the last one. However it can be nice to be able to delete all areas and allow the user to start with a clean image.
I am not too familiar with this plugin so I changed the above check to "this.ui.multi.length > 0" and then I changed the function deleteSelection to :
Probably a clumsy solution but maybe it will help you with a clean solution. Thanks in advance :)
The text was updated successfully, but these errors were encountered: