Merge pull request #529 from VladimirTechMan/master

When setting new text on Konva.Text, treat undefined width or height as 'auto'
This commit is contained in:
Anton Lavrenov 2019-01-08 09:34:07 -05:00 committed by GitHub
commit adcd6b9c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,8 +342,8 @@ export class Text extends Shape {
lineHeightPx = this.lineHeight() * fontSize,
width = this.attrs.width,
height = this.attrs.height,
fixedWidth = width !== AUTO,
fixedHeight = height !== AUTO,
fixedWidth = width !== AUTO && width !== undefined,
fixedHeight = height !== AUTO && height !== undefined,
padding = this.padding(),
maxWidth = width - padding * 2,
maxHeightPx = height - padding * 2,