Comparing version 1.0.1 to 1.0.2
@@ -7,2 +7,8 @@ # Change Log | ||
## [1.0.2][2016-07-08] | ||
## Changed | ||
- `Konva.Text` will interpret undefined `width` and `height` as `AUTO` | ||
## [1.0.1][2016-07-05] | ||
@@ -9,0 +15,0 @@ |
{ | ||
"name": "konva", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Anton Lavrenov", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -23,3 +23,3 @@ ![Konva logo](https://raw.githubusercontent.com/konvajs/konvajs.github.io/master/apple-touch-icon-180x180.png) | ||
```html | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.0.1/konva.min.js"></script> | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.0.2/konva.min.js"></script> | ||
<div id="container"></div> | ||
@@ -69,6 +69,6 @@ <script> | ||
```html | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.0.1/konva.min.js"></script> | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.0.2/konva.min.js"></script> | ||
``` | ||
You can use CDN: [https://cdn.rawgit.com/konvajs/konva/1.0.1/konva.min.js](https://cdn.rawgit.com/konvajs/konva/1.0.1/konva.min.js) | ||
You can use CDN: [https://cdn.rawgit.com/konvajs/konva/1.0.2/konva.min.js](https://cdn.rawgit.com/konvajs/konva/1.0.2/konva.min.js) | ||
@@ -75,0 +75,0 @@ ###2 Load via AMD (requirejs): |
@@ -42,4 +42,2 @@ /*eslint-disable max-depth */ | ||
* @param {Number} [config.padding] | ||
* @param {Number} [config.width] default is auto | ||
* @param {Number} [config.height] default is auto | ||
* @param {Number} [config.lineHeight] default is 1 | ||
@@ -77,10 +75,10 @@ * @param {String} [config.wrap] can be word, char, or none. Default is word | ||
} | ||
// | ||
// if (config.width === undefined) { | ||
// config.width = AUTO; | ||
// } | ||
// if (config.height === undefined) { | ||
// config.height = AUTO; | ||
// } | ||
if (config.width === undefined) { | ||
config.width = AUTO; | ||
} | ||
if (config.height === undefined) { | ||
config.height = AUTO; | ||
} | ||
// call super constructor | ||
@@ -168,3 +166,4 @@ Konva.Shape.call(this, config); | ||
getWidth: function() { | ||
return this.attrs.width === AUTO ? this.getTextWidth() + this.getPadding() * 2 : this.attrs.width; | ||
var isAuto = (this.attrs.width === AUTO) || (this.attrs.width === undefined); | ||
return isAuto ? this.getTextWidth() + this.getPadding() * 2 : this.attrs.width; | ||
}, | ||
@@ -178,3 +177,4 @@ /** | ||
getHeight: function() { | ||
return this.attrs.height === AUTO ? (this.getTextHeight() * this.textArr.length * this.getLineHeight()) + this.getPadding() * 2 : this.attrs.height; | ||
var isAuto = (this.attrs.height === AUTO) || (this.attrs.height === undefined); | ||
return isAuto ? (this.getTextHeight() * this.textArr.length * this.getLineHeight()) + this.getPadding() * 2 : this.attrs.height; | ||
}, | ||
@@ -181,0 +181,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1241799
30090