Adds double-pointing handles action, toggled arrowheads, removes circles.
This commit is contained in:
parent
07f96a8416
commit
7d14791d00
12 changed files with 227 additions and 368 deletions
|
@ -1,41 +0,0 @@
|
|||
import CodeShape from './index'
|
||||
import { uniqueId } from 'utils/utils'
|
||||
import { CircleShape, ShapeType } from 'types'
|
||||
import Utils from './utils'
|
||||
import { defaultStyle } from 'state/shape-styles'
|
||||
|
||||
export default class Circle extends CodeShape<CircleShape> {
|
||||
constructor(props = {} as Partial<CircleShape>) {
|
||||
props.point = Utils.vectorToPoint(props.point)
|
||||
|
||||
super({
|
||||
id: uniqueId(),
|
||||
seed: Math.random(),
|
||||
parentId: (window as any).currentPageId,
|
||||
type: ShapeType.Circle,
|
||||
isGenerated: true,
|
||||
name: 'Circle',
|
||||
childIndex: 0,
|
||||
point: [0, 0],
|
||||
rotation: 0,
|
||||
radius: 20,
|
||||
isAspectRatioLocked: false,
|
||||
isLocked: false,
|
||||
isHidden: false,
|
||||
...props,
|
||||
style: { ...defaultStyle, ...props.style },
|
||||
})
|
||||
}
|
||||
|
||||
export(): CircleShape {
|
||||
const shape = { ...this.shape }
|
||||
|
||||
shape.point = Utils.vectorToPoint(shape.point)
|
||||
|
||||
return shape
|
||||
}
|
||||
|
||||
get radius(): number {
|
||||
return this.shape.radius
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
import Rectangle from './rectangle'
|
||||
import Circle from './circle'
|
||||
import Ellipse from './ellipse'
|
||||
import Polyline from './polyline'
|
||||
import Dot from './dot'
|
||||
|
@ -13,7 +12,6 @@ import { CodeControl, Data, Shape } from 'types'
|
|||
|
||||
const baseScope = {
|
||||
Dot,
|
||||
Circle,
|
||||
Ellipse,
|
||||
Ray,
|
||||
Line,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue