adds hit testing for hovers

This commit is contained in:
Steve Ruiz 2021-05-14 23:56:41 +01:00
parent b8d3b35b07
commit afa8f53dff
25 changed files with 1034 additions and 83 deletions

24
lib/code/rectangle.ts Normal file
View file

@ -0,0 +1,24 @@
import CodeShape from "./index"
import { v4 as uuid } from "uuid"
import { RectangleShape, ShapeType } from "types"
export default class Rectangle extends CodeShape<RectangleShape> {
constructor(props = {} as Partial<RectangleShape>) {
super({
id: uuid(),
type: ShapeType.Rectangle,
name: "Rectangle",
parentId: "page0",
childIndex: 0,
point: [0, 0],
size: [1, 1],
rotation: 0,
style: {},
...props,
})
}
get size() {
return this.shape.size
}
}