Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/tui/src/utils/mod.ts>rectangleIntersection

🦕 Deno module for creating Terminal User Interfaces
Latest
function rectangleIntersection
import { rectangleIntersection } from "https://deno.land/x/tui@2.1.11/src/utils/mod.ts";

Calculate intersection between two rectangles

When data is set to true it returns:

  • collision rectangle when they collide
  • false when they don't

Otherwise it simply returns boolean whether they collide

Don't hold onto intersection object reference that gets returned!

It gets reused to save CPU usage and minimize GC.

Parameters

optional
data: false

Returns

boolean