Skip to content

@ue-too/board / index / boundariesFullyDefined

函式: boundariesFullyDefined()

boundariesFullyDefined(boundaries): boundaries is { max: { x: number; y: number }; min: { x: number; y: number } }

定義於: packages/board/src/camera/utils/position.ts:196

Checks if boundaries have all four constraints (min/max for both x and y) defined.

參數

boundaries

The boundaries to check

Boundaries | undefined

回傳

boundaries is { max: { x: number; y: number }; min: { x: number; y: number } }

True if all four constraints are defined, false otherwise

備註

Returns true only if boundaries define a complete rectangular region:

  • min.x, min.y, max.x, and max.y are all defined

範例

typescript
boundariesFullyDefined({
  min: { x: 0, y: 0 },
  max: { x: 100, y: 100 }
}); // true

boundariesFullyDefined({
  min: { x: 0, y: 0 },
  max: { x: 100 }  // missing max.y
}); // false

boundariesFullyDefined({ min: { x: 0 } }); // false
boundariesFullyDefined(undefined);          // false