DWQA QuestionsCategory: ProgramFabric JS hierarchy problem
charles asked 2 years ago

Because pictures are asynchronous, it is impossible to set zindex directly when drawing pictures, so:
Fabric JS hierarchy problem
I used promise. After the image is loaded successfully, I will use canvas objectc, loading successful picturesimg, andzIndexwithkey: valPush to arraylayerArrAt the same time, push the promise object into the arraypromiseArrAfter all the pictures are drawn, adjust the level code:Fabric JS hierarchy problem
But there are some situations in the data: the current page data is the smallestzIndexMay be-1, or1
fabricSeems to be from0I started sorting, so I made a judgment,-1I will add 1.1I’ll cut one, and thenrenderAll()code:Fabric JS hierarchy problem
Finished rendering
Fabric JS hierarchy problem
In fact, a line of text is covered
Fabric JS hierarchy problem
Solution?
Thank you

1 Answers
Those flowers answered 2 years ago

Have you solved this problem now?