@oazmi/kitchensink - v0.9.13
    Preparing search index...

    Function positiveRect

    • get an equivalent rectangle where the height and width are positive.

      Parameters

      Returns Rect

      import { assertEquals } from "jsr:@std/assert"

      const
      my_rect: Rect = { x: -20, y: 100, width: 50, height: -30 },
      my_abs_rect = positiveRect(my_rect)

      assertEquals(my_abs_rect, {
      x: -20,
      y: 70,
      width: 50,
      height: 30,
      })