Fabric.js: 2.0.1 bringtofront, sendtoback has no effect

Created on 13 Feb 2018  路  5Comments  路  Source: fabricjs/fabric.js

try to learn Fabrik.js
in demo http://fabricjs.com/kitchensink

  1. add image like "google" and text
  2. move text over image
  3. select image object
  4. click tab "Object" to manual control of selected object
  5. clicking buttons "send to back", "bring to front" has no visible effects :( - image still over text
docs

Most helpful comment

So preserveStacking set to false is an odd default that i found in fabric and never changed.
Is odd.

send to back will work as long as you deselect the object and the normal stack is take care of.
I agree that with send back/front, preserveStacking = false is a big mess.

All 5 comments

hmm. this behaviour just when checkbox "Preserve stacking" is unchecked

but when checked it is all OK

So preserveStacking set to false is an odd default that i found in fabric and never changed.
Is odd.

send to back will work as long as you deselect the object and the normal stack is take care of.
I agree that with send back/front, preserveStacking = false is a big mess.

Agreement on the preserveStacking false default, always seemed like an editor feature that didn't really belong on by default, if at all.

Any update on this?

I guess methods like bringToFront should print a warning at least when preserveStacking is set to false as they have no effect at all.

It would be nice to have a dev only set of warnings for those things.
We could wrap them in some special markers and remove them when a build is done in the prod environment.

If you want to start a PR, look for how we mark the SVG_EXPORT code and how we remove it in build.js, we can do the same for those warnings.

Was this page helpful?
0 / 5 - 0 ratings