MCPcopy
hub / github.com/facebook/react / setCanvas

Method setCanvas

packages/react-devtools-timeline/src/view-base/Surface.js:81–92  ·  view source on GitHub ↗
(canvas: HTMLCanvasElement, canvasSize: Size)

Source from the content-addressed store, hash-verified

79 }
80
81 setCanvas(canvas: HTMLCanvasElement, canvasSize: Size) {
82 this._context = getCanvasContext(
83 canvas,
84 canvasSize.height,
85 canvasSize.width,
86 );
87 this._canvasSize = canvasSize;
88
89 if (this.rootView) {
90 this.rootView.setNeedsDisplay();
91 }
92 }
93
94 displayIfNeeded() {
95 const {rootView, _canvasSize, _context} = this;

Callers 1

CanvasPage.jsFile · 0.80

Calls 1

setNeedsDisplayMethod · 0.80

Tested by

no test coverage detected