Skip to content
This repository

sendBackwards and bringForward methods #241

Closed
gazrawicz opened this Issue August 20, 2012 · 3 comments

2 participants

gazrawicz Juriy Zaytsev
gazrawicz

I suggest following changes:

adding one line in sendBackwards:

    for (var i=idx-1; i>=0; --i) {
      if (object.intersectsWithObject(this._objects[i]) ||
          object.isContainedWithinObject(this._objects[i]) ||
          (this._objects[i]).isContainedWithinObject(object)) {   //<--- I think this line is necessary
        nextIntersectingIdx = i;
        break;
      }
    }

analogically in bringForward:

    // 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]) ||
          (this._objects[i]).isContainedWithinObject(object)) {     //<--- this line
        nextIntersectingIdx = i;
        break;
      }
    }
Juriy Zaytsev
Owner

Why is this necessary?

gazrawicz
Juriy Zaytsev
Owner

Yes, I remember we did it like this on purpose. I don't remember what exactly that purpose was :/

Juriy Zaytsev kangax closed this in 48443c1 October 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.