Inline
This commit is contained in:
parent
faf415277e
commit
568e470752
2 changed files with 5 additions and 10 deletions
|
@ -33,14 +33,6 @@ export class Box implements IRect {
|
|||
this.height = height;
|
||||
}
|
||||
|
||||
public get topLeft(): Point {
|
||||
return new Point(this.x, this.y);
|
||||
}
|
||||
|
||||
public get bottomRight(): Point {
|
||||
return new Point(this.x + this.width, this.y + this.height);
|
||||
}
|
||||
|
||||
public round(): Box {
|
||||
const [x, y, width, height] = [
|
||||
this.x,
|
||||
|
|
|
@ -52,8 +52,11 @@ function transformPoints(points: Point[], transform: Matrix) {
|
|||
}
|
||||
|
||||
function transformBox(box: Box, transform: Matrix) {
|
||||
const topLeft = transformPoint(box.topLeft, transform);
|
||||
const bottomRight = transformPoint(box.bottomRight, transform);
|
||||
const topLeft = transformPoint(new Point(box.x, box.y), transform);
|
||||
const bottomRight = transformPoint(
|
||||
new Point(box.x + box.width, box.y + box.height),
|
||||
transform,
|
||||
);
|
||||
|
||||
return new Box({
|
||||
x: topLeft.x,
|
||||
|
|
Loading…
Add table
Reference in a new issue