2021-05-12 21:11:17 +00:00
|
|
|
import Circle from "./circle"
|
|
|
|
import Dot from "./dot"
|
|
|
|
import Polyline from "./polyline"
|
|
|
|
import Rectangle from "./rectangle"
|
|
|
|
|
2021-05-12 22:08:53 +00:00
|
|
|
import { Bounds, Shape, ShapeType } from "types"
|
2021-05-12 21:11:17 +00:00
|
|
|
|
2021-05-12 22:08:53 +00:00
|
|
|
export const boundsCache = new WeakMap<Shape, Bounds>([])
|
|
|
|
|
|
|
|
const shapes = {
|
2021-05-12 21:11:17 +00:00
|
|
|
[ShapeType.Circle]: Circle,
|
|
|
|
[ShapeType.Dot]: Dot,
|
|
|
|
[ShapeType.Polyline]: Polyline,
|
|
|
|
[ShapeType.Rectangle]: Rectangle,
|
2021-05-13 18:22:16 +00:00
|
|
|
[ShapeType.Ellipse]: Rectangle,
|
|
|
|
[ShapeType.Line]: Rectangle,
|
|
|
|
[ShapeType.Ray]: Rectangle,
|
2021-05-12 21:11:17 +00:00
|
|
|
}
|
2021-05-12 22:08:53 +00:00
|
|
|
|
|
|
|
export default shapes
|