Adds more tests for code

This commit is contained in:
Steve Ruiz 2021-06-25 13:21:33 +01:00
parent 776c0b5f0e
commit 75e60d5eb2
6 changed files with 128 additions and 31 deletions

View file

@ -1,7 +1,8 @@
import CodeShape from './index'
import { uniqueId } from 'utils'
import { TextShape, ShapeProps, ShapeType, FontSize } from 'types'
import { TextShape, ShapeProps, ShapeType } from 'types'
import { defaultStyle } from 'state/shape-styles'
import { getShapeUtils } from 'state/shape-utils'
/* ----------------- Start Copy Here ---------------- */
@ -22,7 +23,6 @@ export default class Text extends CodeShape<TextShape> {
isHidden: false,
text: 'Text',
scale: 1,
fontSize: FontSize.Medium,
...props,
style: {
...defaultStyle,
@ -30,4 +30,12 @@ export default class Text extends CodeShape<TextShape> {
},
})
}
get scale(): number {
return this.shape.scale
}
set scale(scale: number) {
getShapeUtils(this.shape).setProperty(this.shape, 'scale', scale)
}
}