mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
fixed logic in Text that was accessing padding attr directly without using the getter
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
|
||||
context.beginPath();
|
||||
context.moveTo(0,0);
|
||||
|
||||
|
||||
if (pointerDirection === UP) {
|
||||
context.lineTo((width - pointerWidth)/2, 0);
|
||||
context.lineTo(width/2, -1 * pointerHeight);
|
||||
|
@@ -152,7 +152,7 @@
|
||||
* @methodOf Kinetic.Text.prototype
|
||||
*/
|
||||
getHeight: function() {
|
||||
return this.attrs.height === AUTO ? (this.getTextHeight() * this.textArr.length * this.getLineHeight()) + this.attrs.padding * 2 : this.attrs.height;
|
||||
return this.attrs.height === AUTO ? (this.getTextHeight() * this.textArr.length * this.getLineHeight()) + this.getPadding() * 2 : this.attrs.height;
|
||||
},
|
||||
/**
|
||||
* get text width
|
||||
|
@@ -14,10 +14,10 @@ Test.Modules.LABEL = {
|
||||
text: {
|
||||
text: 'Hello World!',
|
||||
fontSize: 50,
|
||||
fontFamily: 'Calibri',
|
||||
fontStyle: 'normal',
|
||||
//fontFamily: 'Calibri',
|
||||
//fontStyle: 'normal',
|
||||
lineHeight: 1.2,
|
||||
padding: 10,
|
||||
//padding: 10,
|
||||
fill: 'green'
|
||||
},
|
||||
rect: {
|
||||
@@ -28,7 +28,7 @@ Test.Modules.LABEL = {
|
||||
shadowOffset: [10, 10],
|
||||
shadowOpacity: 0.2,
|
||||
lineJoin: 'round',
|
||||
pointerDirection: 'down',
|
||||
//pointerDirection: 'down',
|
||||
pointerWidth: 20,
|
||||
pointerHeight: 20,
|
||||
cornerRadius: 5
|
||||
|
Reference in New Issue
Block a user