niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.61k stars 4.81k forks source link

z-index issue with html2canvas #903

Closed devPranav closed 7 years ago

devPranav commented 8 years ago

I am trying develop an collage maker in my website where user can place their image anywhere in div and create an collage and download that design as image. I used your cool tool html2canvas for that. It use fine if their is no image overlapping if their is an image overlap then it shows image with negative z-index on upper side of positive z-index i want to convert that div as it is in image but it shows some different behavior in case of image overlapping.please give me solution

hibissscus commented 7 years ago

Yes, have same problem, if I have z-index elements, some of them on the final image are on top - and image looks weird.

niklasvh commented 7 years ago

@hibissscus Can you show an example on jsfiddle?

hibissscus commented 7 years ago

@niklasvh https://jsfiddle.net/69kc2t2y/15/ some overlap

hibissscus commented 7 years ago

@niklasvh I created other example https://jsfiddle.net/8h3r5wr1/ if we scroll table a bit, and then try to take a picture -> we got overlap image

Zaccc123 commented 5 years ago

I got the same issue, @hibissscus do you find any workaround for this?

pupunzi commented 4 years ago

The same here. It doesn't matter what is the z-index assigned to each element; the rendered image has the wrong elements order. You can see an example here: https://www.open-lab.com/storyboarder/footballdrama/ From the right column add different "sprites"; you'll see that the generated thumbnail is wrong. And if you save the image it will be more evident.

This is how it looks in the editor:

Schermata 2020-01-21 alle 11 07 31

And this is the generated image: Board 0

Diegoafv commented 1 year ago

Same.