Adds style panel, styles

This commit is contained in:
Steve Ruiz 2021-05-26 11:34:10 +01:00
parent def8f665d3
commit 6c8499309e
26 changed files with 819 additions and 141 deletions

View file

@ -29,12 +29,12 @@ export default class CodeShape<T extends Shape> {
}
moveTo(point: Vector) {
this.utils.translate(this._shape, vectorToPoint(point))
this.utils.translateTo(this._shape, vectorToPoint(point))
return this
}
translate(delta: Vector) {
this.utils.translate(
this.utils.translateTo(
this._shape,
vec.add(this._shape.point, vectorToPoint(delta))
)
@ -42,7 +42,7 @@ export default class CodeShape<T extends Shape> {
}
rotate(rotation: number) {
this.utils.rotate(this._shape, rotation)
this.utils.rotateTo(this._shape, rotation)
return this
}

View file

@ -18,6 +18,7 @@ export default class Rectangle extends CodeShape<RectangleShape> {
point: [0, 0],
size: [100, 100],
rotation: 0,
radius: 2,
style: {
fill: "#c6cacb",
stroke: "#000",