Adds style panel, styles
This commit is contained in:
parent
def8f665d3
commit
6c8499309e
26 changed files with 819 additions and 141 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue