MCPcopy Index your code
hub / github.com/angular/components / transferCanvasData

Function transferCanvasData

src/cdk/drag-drop/dom/clone-node.ts:73–83  ·  view source on GitHub ↗

Transfers the data of one canvas element to another.

(source: HTMLCanvasElement, clone: HTMLCanvasElement)

Source from the content-addressed store, hash-verified

71
72/** Transfers the data of one canvas element to another. */
73function transferCanvasData(source: HTMLCanvasElement, clone: HTMLCanvasElement) {
74 const context = clone.getContext('2d');
75
76 if (context) {
77 // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0).
78 // We can't do much about it so just ignore the error.
79 try {
80 context.drawImage(source, 0, 0);
81 } catch {}
82 }
83}

Callers 1

deepCloneNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…