mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-16 17:51:07 +00:00
Fix sendBackwards/bringForward methods to work with larger objects covering smaller ones. Fix #241.
This commit is contained in:
parent
5998dfc1a5
commit
48443c193b
2 changed files with 24 additions and 4 deletions
14
dist/all.js
vendored
14
dist/all.js
vendored
|
|
@ -5870,7 +5870,12 @@ fabric.util.string = {
|
|||
|
||||
// traverse down the stack looking for the nearest intersecting object
|
||||
for (var i=idx-1; i>=0; --i) {
|
||||
if (object.intersectsWithObject(this._objects[i]) || object.isContainedWithinObject(this._objects[i])) {
|
||||
|
||||
var isIntersecting = object.intersectsWithObject(this._objects[i]) ||
|
||||
object.isContainedWithinObject(this._objects[i]) ||
|
||||
this._objects[i].isContainedWithinObject(object);
|
||||
|
||||
if (isIntersecting) {
|
||||
nextIntersectingIdx = i;
|
||||
break;
|
||||
}
|
||||
|
|
@ -5899,7 +5904,12 @@ fabric.util.string = {
|
|||
|
||||
// traverse up the stack looking for the nearest intersecting object
|
||||
for (var i = idx + 1, l = this._objects.length; i < l; ++i) {
|
||||
if (object.intersectsWithObject(objects[i]) || object.isContainedWithinObject(this._objects[i])) {
|
||||
|
||||
var isIntersecting = object.intersectsWithObject(objects[i]) ||
|
||||
object.isContainedWithinObject(this._objects[i]) ||
|
||||
this._objects[i].isContainedWithinObject(object);
|
||||
|
||||
if (isIntersecting) {
|
||||
nextIntersectingIdx = i;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -933,7 +933,12 @@
|
|||
|
||||
// traverse down the stack looking for the nearest intersecting object
|
||||
for (var i=idx-1; i>=0; --i) {
|
||||
if (object.intersectsWithObject(this._objects[i]) || object.isContainedWithinObject(this._objects[i])) {
|
||||
|
||||
var isIntersecting = object.intersectsWithObject(this._objects[i]) ||
|
||||
object.isContainedWithinObject(this._objects[i]) ||
|
||||
this._objects[i].isContainedWithinObject(object);
|
||||
|
||||
if (isIntersecting) {
|
||||
nextIntersectingIdx = i;
|
||||
break;
|
||||
}
|
||||
|
|
@ -962,7 +967,12 @@
|
|||
|
||||
// traverse up the stack looking for the nearest intersecting object
|
||||
for (var i = idx + 1, l = this._objects.length; i < l; ++i) {
|
||||
if (object.intersectsWithObject(objects[i]) || object.isContainedWithinObject(this._objects[i])) {
|
||||
|
||||
var isIntersecting = object.intersectsWithObject(objects[i]) ||
|
||||
object.isContainedWithinObject(this._objects[i]) ||
|
||||
this._objects[i].isContainedWithinObject(object);
|
||||
|
||||
if (isIntersecting) {
|
||||
nextIntersectingIdx = i;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue