Skip to content

Commit d2e7bec

Browse files
author
Xie, Ziyu
committed
Release v2.1.9
1 parent 700c271 commit d2e7bec

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ angular2-draggable has angular directives that make the DOM element draggable an
2727
+ provided since v2.0, requires Angular >= 6
2828

2929
# Latest Update
30+
+ 2018.11.29: 2.1.9
31+
+ **ngDraggable**: fix [issue #31](https://github.com/xieziyu/angular2-draggable/issues/31): Problems when scale transform applied to parent. ([by rathodsanjay](https://github.com/rathodsanjay) - [PR #123](https://github.com/xieziyu/angular2-draggable/pull/123))
32+
3033
+ 2018.11.11: 2.1.8
3134
+ **ngResizable**: add [preventDefaultEvent] flag to ngResizable mousedown ([by mecp](https://github.com/mecp) - [PR #119](https://github.com/xieziyu/angular2-draggable/pull/119))
3235

projects/angular2-draggable/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular2-draggable",
3-
"version": "2.1.8",
3+
"version": "2.1.9",
44
"author": "Xie, Ziyu",
55
"license": "MIT",
66
"keywords": [

projects/angular2-draggable/src/lib/angular-draggable.directive.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class AngularDraggableDirective implements OnInit, OnDestroy, OnChanges,
3131
/**
3232
* Flag to indicate whether the element is dragged once after being initialised
3333
*/
34-
private isDragged: boolean = false;
34+
private isDragged = false;
3535

3636
@Output() started = new EventEmitter<any>();
3737
@Output() stopped = new EventEmitter<any>();
@@ -139,10 +139,8 @@ export class AngularDraggableDirective implements OnInit, OnDestroy, OnChanges,
139139
}
140140

141141
if (changes['scale'] && !changes['scale'].isFirstChange()) {
142-
let temp = this.currTrans.value;
143-
temp.x = temp.x * this.scale;
144-
temp.y = temp.y * this.scale;
145-
this.oldTrans.set(new Position(temp.x, temp.y));
142+
this.oldTrans.x = this.currTrans.x * this.scale;
143+
this.oldTrans.y = this.currTrans.y * this.scale;
146144
}
147145
}
148146

@@ -189,14 +187,12 @@ export class AngularDraggableDirective implements OnInit, OnDestroy, OnChanges,
189187
translateY = Math.round(translateY / this.gridSize) * this.gridSize;
190188
}
191189

192-
// done to prevent the element from bouncing off when
190+
// done to prevent the element from bouncing off when
193191
// the parent element is scaled and element is dragged for first time
194192
if (this.tempTrans.x !== 0 || this.tempTrans.y !== 0) {
195193
if (this.isDragged === false) {
196-
let temp = this.currTrans.value;
197-
temp.x = temp.x * this.scale;
198-
temp.y = temp.y * this.scale;
199-
this.oldTrans.set(new Position(temp.x, temp.y));
194+
this.oldTrans.x = this.currTrans.x * this.scale;
195+
this.oldTrans.y = this.currTrans.y * this.scale;
200196
}
201197
this.isDragged = true;
202198
}

projects/angular2-draggable/src/lib/models/position.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Position implements IPosition {
3636
}
3737
}
3838

39-
static copy(p: Position) {
39+
static copy(p: IPosition) {
4040
return new Position(0, 0).set(p);
4141
}
4242

src/assets/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.1.9 (2018-11-29)
2+
3+
#### Bugfix
4+
+ **ngDraggable**: [#31]((https://github.com/xieziyu/angular2-draggable/issues/31)) Problems when scale transform applied to parent. ([by rathodsanjay](https://github.com/rathodsanjay) - [PR #123](https://github.com/xieziyu/angular2-draggable/pull/123))
5+
6+
---
7+
18
## 2.1.8 (2018-11-11)
29

310
#### New
@@ -8,7 +15,7 @@
815
## 2.1.7 (2018-10-31)
916

1017
#### Bugfix
11-
+ **ngResizable**: ngResizable Locks Height When rzHandles Includes Only e, w. [#116](https://github.com/xieziyu/angular2-draggable/issues/116) (Thanks to [Yamazaki93](https://github.com/Yamazaki93))
18+
+ **ngResizable**: [#116](https://github.com/xieziyu/angular2-draggable/issues/116) ngResizable Locks Height When rzHandles Includes Only e, w. (Thanks to [Yamazaki93](https://github.com/Yamazaki93))
1219

1320
---
1421

0 commit comments

Comments
 (0)