
Highlighter is autolocked, so we shouldn't show the lock icon ### Change Type - [x] `patch` — Bug fix [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - We no longer show the tool lock option for highlighter - it didn't do anything anyway
309 lines
3.7 KiB
Text
309 lines
3.7 KiB
Text
---
|
|
title: BaseBoxShapeUtil
|
|
status: published
|
|
category: editor
|
|
group: Class
|
|
author: api
|
|
date: 06/23/2023
|
|
order: 6
|
|
---<Small>Public Class</Small>
|
|
|
|
<details>
|
|
<summary>Table of Contents</summary>
|
|
- [Properties](#properties)
|
|
- [onResize](#BaseBoxShapeUtil-onResize-member)
|
|
- [Methods](#methods)
|
|
- [getBounds](#BaseBoxShapeUtil-getBounds-member-1)
|
|
- [getCenter](#BaseBoxShapeUtil-getCenter-member-1)
|
|
- [getOutline](#BaseBoxShapeUtil-getOutline-member-1)
|
|
- [hitTestLineSegment](#BaseBoxShapeUtil-hitTestLineSegment-member-1)
|
|
- [hitTestPoint](#BaseBoxShapeUtil-hitTestPoint-member-1)
|
|
</details>
|
|
|
|
|
|
|
|
|
|
##### Signature
|
|
|
|
|
|
```ts
|
|
abstract class BaseBoxShapeUtil<
|
|
Shape extends TLBaseBoxShape
|
|
> extends ShapeUtil<Shape> {}
|
|
```
|
|
|
|
##### References
|
|
|
|
[TLBaseBoxShape](/gen/editor/TLBaseBoxShape-type), [ShapeUtil](/gen/editor/ShapeUtil-class)
|
|
|
|
---
|
|
|
|
## Properties
|
|
|
|
### `onResize` \{#BaseBoxShapeUtil-onResize-member}
|
|
|
|
<Small>Public Property</Small>
|
|
|
|
##### Signature
|
|
|
|
|
|
```ts
|
|
onResize: TLOnResizeHandler<any>
|
|
```
|
|
|
|
##### References
|
|
|
|
[TLOnResizeHandler](/gen/editor/TLOnResizeHandler-type)
|
|
|
|
---
|
|
|
|
## Methods
|
|
|
|
### `getBounds()` \{#BaseBoxShapeUtil-getBounds-member-1}
|
|
|
|
<Small>Public Method</Small>
|
|
|
|
##### Parameters
|
|
|
|
|
|
<ParametersTable>
|
|
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`shape`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
Shape
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
</ParametersTable>
|
|
|
|
##### Returns
|
|
|
|
|
|
```ts
|
|
Box2d
|
|
```
|
|
|
|
##### References
|
|
|
|
[Box2d](/gen/primitives/Box2d-class)
|
|
|
|
---
|
|
|
|
### `getCenter()` \{#BaseBoxShapeUtil-getCenter-member-1}
|
|
|
|
<Small>Public Method</Small>
|
|
|
|
##### Parameters
|
|
|
|
|
|
<ParametersTable>
|
|
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`shape`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
Shape
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
</ParametersTable>
|
|
|
|
##### Returns
|
|
|
|
|
|
```ts
|
|
Vec2d
|
|
```
|
|
|
|
##### References
|
|
|
|
[Vec2d](/gen/primitives/Vec2d-class)
|
|
|
|
---
|
|
|
|
### `getOutline()` \{#BaseBoxShapeUtil-getOutline-member-1}
|
|
|
|
<Small>Public Method</Small>
|
|
|
|
##### Parameters
|
|
|
|
|
|
<ParametersTable>
|
|
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`shape`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
Shape
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
</ParametersTable>
|
|
|
|
##### Returns
|
|
|
|
|
|
```ts
|
|
Vec2d[]
|
|
```
|
|
|
|
##### References
|
|
|
|
[Vec2d](/gen/primitives/Vec2d-class)
|
|
|
|
---
|
|
|
|
### `hitTestLineSegment()` \{#BaseBoxShapeUtil-hitTestLineSegment-member-1}
|
|
|
|
<Small>Public Method</Small>
|
|
|
|
##### Parameters
|
|
|
|
|
|
<ParametersTable>
|
|
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`shape`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
Shape
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`A`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
VecLike
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`B`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
VecLike
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
</ParametersTable>
|
|
|
|
##### Returns
|
|
|
|
|
|
```ts
|
|
boolean
|
|
```
|
|
|
|
##### References
|
|
|
|
[VecLike](/gen/primitives/VecLike-type)
|
|
|
|
---
|
|
|
|
### `hitTestPoint()` \{#BaseBoxShapeUtil-hitTestPoint-member-1}
|
|
|
|
<Small>Public Method</Small>
|
|
|
|
##### Parameters
|
|
|
|
|
|
<ParametersTable>
|
|
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`shape`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
Shape
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
<ParametersTableRow>
|
|
<ParametersTableName>
|
|
|
|
`point`
|
|
|
|
</ParametersTableName>
|
|
<ParametersTableDescription>
|
|
|
|
```ts
|
|
VecLike
|
|
```
|
|
|
|
|
|
|
|
</ParametersTableDescription>
|
|
</ParametersTableRow>
|
|
</ParametersTable>
|
|
|
|
##### Returns
|
|
|
|
|
|
```ts
|
|
boolean
|
|
```
|
|
|
|
##### References
|
|
|
|
[VecLike](/gen/primitives/VecLike-type)
|
|
|
|
---
|
|
|