@wcardinal/wcardinal-ui 0.377.0 → 0.378.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.377.0
2
+ Winter Cardinal UI v0.378.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -16207,10 +16207,23 @@ var DViewImpl = /** @class */ (function (_super) {
16207
16207
  var parent = this._parent;
16208
16208
  var target = this._toTarget(parent);
16209
16209
  if (target) {
16210
- var targetRect = target.getLocalBounds(this._workRect);
16211
- var newTargetX = (parent.width - targetRect.width) * 0.5 - targetRect.x;
16212
- var newTargetY = (parent.height - targetRect.height) * 0.5 - targetRect.y;
16213
- this._transform.start(target, newTargetX, newTargetY, 1, 1, duration, stop);
16210
+ var padding = parent.padding;
16211
+ var pl = padding.getLeft();
16212
+ var pt = padding.getTop();
16213
+ var pr = padding.getRight();
16214
+ var pb = padding.getBottom();
16215
+ var w = parent.width;
16216
+ var h = parent.height;
16217
+ var sw = w - pl - pr;
16218
+ var sh = h - pt - pb;
16219
+ var trect = target.getLocalBounds(this._workRect);
16220
+ var tx = trect.x;
16221
+ var ty = trect.y;
16222
+ var tw = trect.width;
16223
+ var th = trect.height;
16224
+ var ntx = pl + (sw - tw) * 0.5 - tx;
16225
+ var nty = pt + (sh - th) * 0.5 - ty;
16226
+ this._transform.start(target, ntx, nty, 1, 1, duration, stop);
16214
16227
  }
16215
16228
  };
16216
16229
  DViewImpl.prototype.fit = function (duration, stop) {
@@ -16218,29 +16231,33 @@ var DViewImpl = /** @class */ (function (_super) {
16218
16231
  var target = this._toTarget(parent);
16219
16232
  if (target) {
16220
16233
  var padding = parent.padding;
16221
- var width = parent.width;
16222
- var height = parent.height;
16223
- var targetRect = target.getLocalBounds(this._workRect);
16224
- var targetX = targetRect.x;
16225
- var targetY = targetRect.y;
16226
- var targetWidth = targetRect.width;
16227
- var targetHeight = targetRect.height;
16228
- var newTargetScaleX = (width - padding.getLeft() - padding.getRight()) / targetWidth;
16229
- var newTargetScaleY = (height - padding.getTop() - padding.getBottom()) / targetHeight;
16234
+ var pl = padding.getLeft();
16235
+ var pt = padding.getTop();
16236
+ var pr = padding.getRight();
16237
+ var pb = padding.getBottom();
16238
+ var w = parent.width;
16239
+ var h = parent.height;
16240
+ var sw = w - pl - pr;
16241
+ var sh = h - pt - pb;
16242
+ var trect = target.getLocalBounds(this._workRect);
16243
+ var tx = trect.x;
16244
+ var ty = trect.y;
16245
+ var tw = trect.width;
16246
+ var th = trect.height;
16247
+ var ntsx = sw / tw;
16248
+ var ntsy = sh / th;
16230
16249
  if (this._zoomKeepRatio) {
16231
- var newTargetScale = this.toNormalizedScale(Math.min(newTargetScaleX, newTargetScaleY));
16232
- newTargetScaleX = newTargetScale;
16233
- newTargetScaleY = newTargetScale;
16250
+ var nts = this.toNormalizedScale(Math.min(ntsx, ntsy));
16251
+ ntsx = nts;
16252
+ ntsy = nts;
16234
16253
  }
16235
16254
  else {
16236
- newTargetScaleX = this.toNormalizedScale(newTargetScaleX);
16237
- newTargetScaleY = this.toNormalizedScale(newTargetScaleY);
16255
+ ntsx = this.toNormalizedScale(ntsx);
16256
+ ntsy = this.toNormalizedScale(ntsy);
16238
16257
  }
16239
- var newTargetWidth = targetWidth * newTargetScaleX;
16240
- var newTargetHeight = targetHeight * newTargetScaleY;
16241
- var newTargetX = (width - newTargetWidth) * 0.5 - targetX * newTargetScaleX;
16242
- var newTargetY = (height - newTargetHeight) * 0.5 - targetY * newTargetScaleY;
16243
- this._transform.start(target, newTargetX, newTargetY, newTargetScaleX, newTargetScaleY, duration, stop);
16258
+ var ntx = pl + (sw - tw * ntsx) * 0.5 - tx * ntsx;
16259
+ var nty = pt + (sh - th * ntsy) * 0.5 - ty * ntsy;
16260
+ this._transform.start(target, ntx, nty, ntsx, ntsy, duration, stop);
16244
16261
  }
16245
16262
  };
16246
16263
  DViewImpl.prototype.zoomIn = function (duration, stop) {
@@ -56430,10 +56447,10 @@ var DThemeWhiteView = /** @class */ (function () {
56430
56447
  return 333;
56431
56448
  };
56432
56449
  DThemeWhiteView.prototype.getZoomMin = function () {
56433
- return 0.05;
56450
+ return 0.01;
56434
56451
  };
56435
56452
  DThemeWhiteView.prototype.getZoomMax = function () {
56436
- return 20;
56453
+ return 100;
56437
56454
  };
56438
56455
  DThemeWhiteView.prototype.getZoomKeepRatio = function () {
56439
56456
  return true;
@@ -65717,10 +65734,10 @@ var DThemeDarkView = /** @class */ (function () {
65717
65734
  return 333;
65718
65735
  };
65719
65736
  DThemeDarkView.prototype.getZoomMin = function () {
65720
- return 0.05;
65737
+ return 0.01;
65721
65738
  };
65722
65739
  DThemeDarkView.prototype.getZoomMax = function () {
65723
- return 20;
65740
+ return 100;
65724
65741
  };
65725
65742
  DThemeDarkView.prototype.getZoomKeepRatio = function () {
65726
65743
  return true;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.377.0
2
+ Winter Cardinal UI v0.378.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -16204,10 +16204,23 @@
16204
16204
  var parent = this._parent;
16205
16205
  var target = this._toTarget(parent);
16206
16206
  if (target) {
16207
- var targetRect = target.getLocalBounds(this._workRect);
16208
- var newTargetX = (parent.width - targetRect.width) * 0.5 - targetRect.x;
16209
- var newTargetY = (parent.height - targetRect.height) * 0.5 - targetRect.y;
16210
- this._transform.start(target, newTargetX, newTargetY, 1, 1, duration, stop);
16207
+ var padding = parent.padding;
16208
+ var pl = padding.getLeft();
16209
+ var pt = padding.getTop();
16210
+ var pr = padding.getRight();
16211
+ var pb = padding.getBottom();
16212
+ var w = parent.width;
16213
+ var h = parent.height;
16214
+ var sw = w - pl - pr;
16215
+ var sh = h - pt - pb;
16216
+ var trect = target.getLocalBounds(this._workRect);
16217
+ var tx = trect.x;
16218
+ var ty = trect.y;
16219
+ var tw = trect.width;
16220
+ var th = trect.height;
16221
+ var ntx = pl + (sw - tw) * 0.5 - tx;
16222
+ var nty = pt + (sh - th) * 0.5 - ty;
16223
+ this._transform.start(target, ntx, nty, 1, 1, duration, stop);
16211
16224
  }
16212
16225
  };
16213
16226
  DViewImpl.prototype.fit = function (duration, stop) {
@@ -16215,29 +16228,33 @@
16215
16228
  var target = this._toTarget(parent);
16216
16229
  if (target) {
16217
16230
  var padding = parent.padding;
16218
- var width = parent.width;
16219
- var height = parent.height;
16220
- var targetRect = target.getLocalBounds(this._workRect);
16221
- var targetX = targetRect.x;
16222
- var targetY = targetRect.y;
16223
- var targetWidth = targetRect.width;
16224
- var targetHeight = targetRect.height;
16225
- var newTargetScaleX = (width - padding.getLeft() - padding.getRight()) / targetWidth;
16226
- var newTargetScaleY = (height - padding.getTop() - padding.getBottom()) / targetHeight;
16231
+ var pl = padding.getLeft();
16232
+ var pt = padding.getTop();
16233
+ var pr = padding.getRight();
16234
+ var pb = padding.getBottom();
16235
+ var w = parent.width;
16236
+ var h = parent.height;
16237
+ var sw = w - pl - pr;
16238
+ var sh = h - pt - pb;
16239
+ var trect = target.getLocalBounds(this._workRect);
16240
+ var tx = trect.x;
16241
+ var ty = trect.y;
16242
+ var tw = trect.width;
16243
+ var th = trect.height;
16244
+ var ntsx = sw / tw;
16245
+ var ntsy = sh / th;
16227
16246
  if (this._zoomKeepRatio) {
16228
- var newTargetScale = this.toNormalizedScale(Math.min(newTargetScaleX, newTargetScaleY));
16229
- newTargetScaleX = newTargetScale;
16230
- newTargetScaleY = newTargetScale;
16247
+ var nts = this.toNormalizedScale(Math.min(ntsx, ntsy));
16248
+ ntsx = nts;
16249
+ ntsy = nts;
16231
16250
  }
16232
16251
  else {
16233
- newTargetScaleX = this.toNormalizedScale(newTargetScaleX);
16234
- newTargetScaleY = this.toNormalizedScale(newTargetScaleY);
16235
- }
16236
- var newTargetWidth = targetWidth * newTargetScaleX;
16237
- var newTargetHeight = targetHeight * newTargetScaleY;
16238
- var newTargetX = (width - newTargetWidth) * 0.5 - targetX * newTargetScaleX;
16239
- var newTargetY = (height - newTargetHeight) * 0.5 - targetY * newTargetScaleY;
16240
- this._transform.start(target, newTargetX, newTargetY, newTargetScaleX, newTargetScaleY, duration, stop);
16252
+ ntsx = this.toNormalizedScale(ntsx);
16253
+ ntsy = this.toNormalizedScale(ntsy);
16254
+ }
16255
+ var ntx = pl + (sw - tw * ntsx) * 0.5 - tx * ntsx;
16256
+ var nty = pt + (sh - th * ntsy) * 0.5 - ty * ntsy;
16257
+ this._transform.start(target, ntx, nty, ntsx, ntsy, duration, stop);
16241
16258
  }
16242
16259
  };
16243
16260
  DViewImpl.prototype.zoomIn = function (duration, stop) {