Merge pull request #151 from jareguo/v0.7

small fix for widget
This commit is contained in:
Jare Guo
2015-12-29 14:56:16 +08:00
+4 -4
View File
@@ -144,16 +144,16 @@ var adjustWidgetToAllowMovingInEditor = CC_EDITOR && function (event) {
var deltaInPercent = cc.v2(delta.x / parentSize.width, delta.y / parentSize.height);
if (this.isAlignTop) {
this.top -= (this.isAbsTop ? delta.y : deltaInPercent.y);
this.top -= (this.isAbsoluteTop ? delta.y : deltaInPercent.y);
}
if (this.isAlignBottom) {
this.bottom += (this.isAbsBottom ? delta.y : deltaInPercent.y);
this.bottom += (this.isAbsoluteBottom ? delta.y : deltaInPercent.y);
}
if (this.isAlignLeft) {
this.left += (this.isAbsLeft ? delta.x : deltaInPercent.x);
this.left += (this.isAbsoluteLeft ? delta.x : deltaInPercent.x);
}
if (this.isAlignRight) {
this.right -= (this.isAbsRight ? delta.x : deltaInPercent.x);
this.right -= (this.isAbsoluteRight ? delta.x : deltaInPercent.x);
}
if (this.isAlignHorizontalCenter) {
if (oldPos.x !== newPos.x) {