mirror of
https://github.com/konvajs/konva.git
synced 2026-01-09 11:34:38 +08:00
Setting text on Konva.Text, treat undefined width or height as 'auto'
Similar to how it's handled in getWidth() and getHeight() of Konva.Text, let _setTextData() treat undefined values of the 'width' and 'height' attributes as if they are set to 'auto', not as if they are fixed.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user