Adds quick style selects, rewrites styling

This commit is contained in:
Steve Ruiz 2021-06-02 12:50:34 +01:00
parent 815bf1109c
commit 7c768bddf5
45 changed files with 867 additions and 630 deletions

View file

@ -2,6 +2,7 @@ import CodeShape from './index'
import { v4 as uuid } from 'uuid'
import { CircleShape, ShapeType } from 'types'
import { vectorToPoint } from 'utils/utils'
import { defaultStyle } from 'lib/shape-styles'
export default class Circle extends CodeShape<CircleShape> {
constructor(props = {} as Partial<CircleShape>) {
@ -20,11 +21,7 @@ export default class Circle extends CodeShape<CircleShape> {
isAspectRatioLocked: false,
isLocked: false,
isHidden: false,
style: {
fill: '#c6cacb',
stroke: '#000',
strokeWidth: 1,
},
style: defaultStyle,
...props,
})
}

View file

@ -2,6 +2,7 @@ import CodeShape from './index'
import { v4 as uuid } from 'uuid'
import { DotShape, ShapeType } from 'types'
import { vectorToPoint } from 'utils/utils'
import { defaultStyle } from 'lib/shape-styles'
export default class Dot extends CodeShape<DotShape> {
constructor(props = {} as Partial<DotShape>) {
@ -19,12 +20,12 @@ export default class Dot extends CodeShape<DotShape> {
isAspectRatioLocked: false,
isLocked: false,
isHidden: false,
style: {
fill: '#c6cacb',
stroke: '#000',
strokeWidth: 1,
},
...props,
style: {
...defaultStyle,
...props.style,
isFilled: false,
},
})
}

View file

@ -2,6 +2,7 @@ import CodeShape from './index'
import { v4 as uuid } from 'uuid'
import { EllipseShape, ShapeType } from 'types'
import { vectorToPoint } from 'utils/utils'
import { defaultStyle } from 'lib/shape-styles'
export default class Ellipse extends CodeShape<EllipseShape> {
constructor(props = {} as Partial<EllipseShape>) {
@ -21,11 +22,7 @@ export default class Ellipse extends CodeShape<EllipseShape> {
isAspectRatioLocked: false,
isLocked: false,
isHidden: false,
style: {
fill: '#c6cacb',
stroke: '#000',
strokeWidth: 1,
},
style: defaultStyle,
...props,
})
}

View file

@ -2,6 +2,7 @@ import CodeShape from './index'
import { v4 as uuid } from 'uuid'
import { LineShape, ShapeType } from 'types'
import { vectorToPoint } from 'utils/utils'
import { defaultStyle } from 'lib/shape-styles'
export default class Line extends CodeShape<LineShape> {
constructor(props = {} as Partial<LineShape>) {
@ -21,12 +22,12 @@ export default class Line extends CodeShape<LineShape> {
isAspectRatioLocked: false,
isLocked: false,
isHidden: false,
style: {
fill: '#c6cacb',
stroke: '#000',
strokeWidth: 1,
},
...props,
style: {
...defaultStyle,
...props.style,
isFilled: false,
},
})
}

View file

@ -2,6 +2,7 @@ import CodeShape from './index'
import { v4 as uuid } from 'uuid'
import { PolylineShape, ShapeType } from 'types'
import { vectorToPoint } from 'utils/utils'
import { defaultStyle } from 'lib/shape-styles'
export default class Polyline extends CodeShape<PolylineShape> {
constructor(props = {} as Partial<PolylineShape>) {
@ -21,11 +22,7 @@ export default class Polyline extends CodeShape<PolylineShape> {
isAspectRatioLocked: false,
isLocked: false,
isHidden: false,
style: {
fill: 'none',
stroke: '#000',
strokeWidth: 1,
},
style: defaultStyle,
...props,
})
}

View file

@ -2,6 +2,7 @@ import CodeShape from './index'
import { v4 as uuid } from 'uuid'
import { RayShape, ShapeType } from 'types'
import { vectorToPoint } from 'utils/utils'
import { defaultStyle } from 'lib/shape-styles'
export default class Ray extends CodeShape<RayShape> {
constructor(props = {} as Partial<RayShape>) {
@ -21,12 +22,12 @@ export default class Ray extends CodeShape<RayShape> {
isAspectRatioLocked: false,
isLocked: false,
isHidden: false,
style: {
fill: '#c6cacb',
stroke: '#000',
strokeWidth: 1,
},
...props,
style: {
...defaultStyle,
...props.style,
isFilled: false,
},
})
}

View file

@ -2,6 +2,7 @@ import CodeShape from './index'
import { v4 as uuid } from 'uuid'
import { RectangleShape, ShapeType } from 'types'
import { vectorToPoint } from 'utils/utils'
import { defaultStyle } from 'lib/shape-styles'
export default class Rectangle extends CodeShape<RectangleShape> {
constructor(props = {} as Partial<RectangleShape>) {
@ -22,11 +23,7 @@ export default class Rectangle extends CodeShape<RectangleShape> {
isAspectRatioLocked: false,
isLocked: false,
isHidden: false,
style: {
fill: '#c6cacb',
stroke: '#000',
strokeWidth: 1,
},
style: defaultStyle,
...props,
})
}