New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get/Set zindex of an object? #135
Comments
There's no way to retrieve z-index of an object via You can also do something like |
thx, that is what I needed! |
Example in https://www.lulufrenchie.com/fr/lab
function inser_valide(imageObj1){ if($("#pitcos").html()!=""){
imageObj1.onload = function() { fabric.Image.fromURL(oImg1, function(oImg1) { oImg1.set({left:80,top:15});
var props=""; canvas1.add(oImg1); });
|
Getting the z-Index via canvas.getObjects().indexOf(myObject) is nice. But what about setting the z-index explicitly? Can someone add canvas.setIndex(myObject, 3) or something similiar? |
I extended fabric objects to get zindex and addToPosition:
|
@StephaneBischoff @filiperoberto |
I see that when you add new object(rect, circle...) to canvas it appears on top of the previous one. And it looks like it's zindex is greater for new elements. But
gives me undefined.
I would like to to be able to read object's zindex and change it.
I saw this but this is not helping me since I have to compare object's zindexes.
The text was updated successfully, but these errors were encountered: