Comparing version 2.4.0 to 2.4.1
@@ -8,9 +8,18 @@ # Change Log | ||
## [2.4.0][2018-09-19] | ||
## [2.4.1][2018-10-08] | ||
### Changed | ||
* Added some text trim logic to wrap in better | ||
### Fixed | ||
* Tween support for gradient properties | ||
* Add `user-select: none` to the stage container to fix some "selected contend around" issues | ||
* `getClientRect` for complex paths fixes | ||
* `getClientRect` calculation fix for groups | ||
* Update `Konva.Transformer` on `rotateEnabled` change | ||
* Fix click stage event on dragend | ||
* Fix some Transformer cursor behavior | ||
## [2.4.0][2018-09-19] | ||
### Added | ||
@@ -21,2 +30,8 @@ | ||
### Fixed | ||
* Tween support for gradient properties | ||
* Add `user-select: none` to the stage container to fix some "selected contend around" issues | ||
## [2.3.0][2018-08-30] | ||
@@ -23,0 +38,0 @@ |
@@ -1002,2 +1002,3 @@ declare namespace Konva { | ||
align?: string; | ||
verticalAlign?: string; | ||
padding?: number; | ||
@@ -1025,2 +1026,4 @@ lineHeight?: number; | ||
align(align: string): this; | ||
verticalAlign(): string; | ||
verticalAlign(verticalAlign: string): this; | ||
padding(): number; | ||
@@ -1027,0 +1030,0 @@ padding(padding: number): this; |
{ | ||
"name": "konva", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"author": "Anton Lavrenov", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -26,3 +26,3 @@ <p align="center"> | ||
```html | ||
<script src="https://cdn.rawgit.com/konvajs/konva/2.4.0/konva.min.js"></script> | ||
<script src="https://cdn.rawgit.com/konvajs/konva/2.4.1/konva.min.js"></script> | ||
<div id="container"></div> | ||
@@ -29,0 +29,0 @@ <script> |
@@ -512,6 +512,5 @@ (function() { | ||
// skip invisible children (like empty groups) | ||
// or don't skip... hmmm... | ||
// if (rect.width === 0 && rect.height === 0) { | ||
// return; | ||
// } | ||
if (rect.width === 0 && rect.height === 0) { | ||
return; | ||
} | ||
@@ -537,3 +536,3 @@ if (minX === undefined) { | ||
var shape = shapes[i]; | ||
if (shape.getVisible()) { | ||
if (shape._isVisible(this)) { | ||
hasVisible = true; | ||
@@ -540,0 +539,0 @@ break; |
@@ -116,6 +116,13 @@ /*eslint-disable no-shadow, max-len, max-depth */ | ||
y = points[i * 2 + 1]; | ||
minX = Math.min(minX, x); | ||
maxX = Math.max(maxX, x); | ||
minY = Math.min(minY, y); | ||
maxY = Math.max(maxY, y); | ||
// skip bad values | ||
// TODO: prevent them from parsing function | ||
if (!isNaN(x)) { | ||
minX = Math.min(minX, x); | ||
maxX = Math.max(maxX, x); | ||
} | ||
if (!isNaN(y)) { | ||
minY = Math.min(minY, y); | ||
maxY = Math.max(maxY, y); | ||
} | ||
} | ||
@@ -451,2 +458,4 @@ return { | ||
p.push(parsed); | ||
} else { | ||
p.push(0); | ||
} | ||
@@ -453,0 +462,0 @@ } |
@@ -164,2 +164,5 @@ (function() { | ||
start: function() { | ||
if (this.isRunning()) { | ||
return; | ||
} | ||
var layer = this.getLayer(); | ||
@@ -166,0 +169,0 @@ |
@@ -374,2 +374,3 @@ /*eslint-disable max-depth */ | ||
wrap = this.getWrap(), | ||
// align = this.getAlign(), | ||
shouldWrap = wrap !== NONE, | ||
@@ -442,2 +443,5 @@ wrapAtWord = wrap !== CHAR && shouldWrap, | ||
} | ||
// if (align === 'right') { | ||
match = match.trimRight(); | ||
// } | ||
this._addTextLine(match); | ||
@@ -457,2 +461,3 @@ textWidth = Math.max(textWidth, matchWidth); | ||
line = line.slice(low); | ||
line = line.trimLeft(); | ||
if (line.length > 0) { | ||
@@ -459,0 +464,0 @@ // Check if the remaining text would fit on one line |
@@ -7,2 +7,3 @@ (function(Konva) { | ||
'rotateAnchorOffsetChange', | ||
'rotateEnabledChange', | ||
'enabledAnchorsChange', | ||
@@ -335,3 +336,2 @@ 'anchorSizeChange', | ||
anchor.on('mouseenter', function() { | ||
var layer = this.getLayer(); | ||
var tr = this.getParent(); | ||
@@ -346,11 +346,10 @@ | ||
anchor.getStage().content.style.cursor = cursor; | ||
layer.batchDraw(); | ||
tr._cursorChange = true; | ||
}); | ||
anchor.on('mouseout', function() { | ||
var layer = this.getLayer(); | ||
if (!layer) { | ||
if (!anchor.getStage() || !this.getParent()) { | ||
return; | ||
} | ||
anchor.getStage().content.style.cursor = ''; | ||
layer.batchDraw(); | ||
this.getParent()._cursorChange = false; | ||
}); | ||
@@ -435,2 +434,4 @@ this.add(anchor); | ||
// console.log(keepProportion); | ||
if (this.movingResizer === 'top-left') { | ||
@@ -593,2 +594,4 @@ if (keepProportion) { | ||
console.log(topOffsetX, topOffsetY, bottomOffsetX, bottomOffsetY); | ||
bottomRight.move({ | ||
@@ -615,2 +618,4 @@ x: -topOffsetX, | ||
// console.log(x, y, width, height); | ||
this._fitNodeInto( | ||
@@ -812,2 +817,6 @@ { | ||
destroy: function() { | ||
// console.log(this.isTransforming() && this.getStage()); | ||
if (this.getStage() && this._cursorChange) { | ||
this.getStage().content.style.cursor = ''; | ||
} | ||
Konva.Group.prototype.destroy.call(this); | ||
@@ -814,0 +823,0 @@ this.detach(); |
@@ -569,3 +569,6 @@ (function() { | ||
this._fire(MOUSEUP, { evt: evt, target: this, currentTarget: this }); | ||
this._fire(CLICK, { evt: evt, target: this, currentTarget: this }); | ||
if (Konva.listenClickTap) { | ||
this._fire(CLICK, { evt: evt, target: this, currentTarget: this }); | ||
} | ||
if (fireDblClick) { | ||
@@ -675,3 +678,5 @@ this._fire(DBL_CLICK, { | ||
this._fire(TOUCHEND, { evt: evt, target: this, currentTarget: this }); | ||
this._fire(TAP, { evt: evt, target: this, currentTarget: this }); | ||
if (Konva.listenClickTap) { | ||
this._fire(TAP, { evt: evt, target: this, currentTarget: this }); | ||
} | ||
if (fireDblClick) { | ||
@@ -678,0 +683,0 @@ this._fire(DBL_TAP, { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1341122
38621