mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-08 22:04:44 +00:00
Merge pull request #895 from Kienz/patch-1
Invisible objects are no longer selectable with "selection-mode" (canvas.selection = true) - Closes issue #891
This commit is contained in:
commit
79efcbf206
1 changed files with 10 additions and 9 deletions
|
|
@ -739,8 +739,11 @@
|
|||
|
||||
/**
|
||||
* @private
|
||||
* @param {Event} e mouse event
|
||||
*/
|
||||
_findSelectedObjects: function (e) {
|
||||
if (!this.selection) return;
|
||||
|
||||
var group = [ ],
|
||||
x1 = this._groupSelector.ex,
|
||||
y1 = this._groupSelector.ey,
|
||||
|
|
@ -754,20 +757,18 @@
|
|||
for (var i = this._objects.length; i--; ) {
|
||||
currentObject = this._objects[i];
|
||||
|
||||
if (!currentObject) continue;
|
||||
if (!currentObject || !currentObject.selectable || !currentObject.visible) continue;
|
||||
|
||||
if (currentObject.intersectsWithRect(selectionX1Y1, selectionX2Y2) ||
|
||||
currentObject.isContainedWithinRect(selectionX1Y1, selectionX2Y2) ||
|
||||
currentObject.containsPoint(selectionX1Y1) ||
|
||||
currentObject.containsPoint(selectionX2Y2)) {
|
||||
currentObject.containsPoint(selectionX2Y2)
|
||||
) {
|
||||
currentObject.set('active', true);
|
||||
group.push(currentObject);
|
||||
|
||||
if (this.selection && currentObject.selectable) {
|
||||
currentObject.set('active', true);
|
||||
group.push(currentObject);
|
||||
|
||||
// only add one object if it's a click
|
||||
if (isClick) break;
|
||||
}
|
||||
// only add one object if it's a click
|
||||
if (isClick) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue