Home / Function/ cacheFirstGetCanvasBoundingRect() — react Function Reference

cacheFirstGetCanvasBoundingRect() — react Function Reference

Architecture documentation for the cacheFirstGetCanvasBoundingRect() function in useCanvasInteraction.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  9498c99a_c485_169d_b328_bad4eeeb7713["cacheFirstGetCanvasBoundingRect()"]
  c31109e4_56cc_8bde_2f0a_c3a35a729719["useCanvasInteraction.js"]
  9498c99a_c485_169d_b328_bad4eeeb7713 -->|defined in| c31109e4_56cc_8bde_2f0a_c3a35a729719
  style 9498c99a_c485_169d_b328_bad4eeeb7713 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/view-base/useCanvasInteraction.js lines 96–112

function cacheFirstGetCanvasBoundingRect(
  canvas: HTMLCanvasElement,
): ClientRect {
  if (
    canvasBoundingRectCache &&
    canvas.width === canvasBoundingRectCache.width &&
    canvas.height === canvasBoundingRectCache.height
  ) {
    return canvasBoundingRectCache.rect;
  }
  canvasBoundingRectCache = {
    width: canvas.width,
    height: canvas.height,
    rect: canvas.getBoundingClientRect(),
  };
  return canvasBoundingRectCache.rect;
}

Domain

Subdomains

Frequently Asked Questions

What does cacheFirstGetCanvasBoundingRect() do?
cacheFirstGetCanvasBoundingRect() is a function in the react codebase, defined in packages/react-devtools-timeline/src/view-base/useCanvasInteraction.js.
Where is cacheFirstGetCanvasBoundingRect() defined?
cacheFirstGetCanvasBoundingRect() is defined in packages/react-devtools-timeline/src/view-base/useCanvasInteraction.js at line 96.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free