tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.21k stars 1.68k forks source link

Please add x,y position options #378

Open RohJooHoon opened 3 years ago

RohJooHoon commented 3 years ago

Please add options x, y for manual adjustment because there is a problem with the capture position of dom with Absolute properties and margin properties.

// add please 43 line

// add please 72 line if (options.x && options.y) { clone.style.transform = translate(-${options.x}px, -${options.y}px); } else if (options.x) { clone.style.transform = translateX(-${options.x}px); } else if (options.y) { clone.style.transform = translateY(-${options.y}px); }