Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selected object automatically brought to front

Whenever I select an item in the canvas , it is automatically brought to the top leaving all the objects behind. Is there any way I can stop this from happening?

like image 631
user223313 Avatar asked Aug 08 '16 05:08

user223313


1 Answers

Set the "preserveObjectStacking" property of the fabricjs canvas to true to stop the bringtofront on selected objects.

var canvas = new fabric.Canvas('canvas');
canvas.preserveObjectStacking = true;
like image 172
Saadi Avatar answered Nov 16 '22 23:11

Saadi