@one2x/medeo-rte 0.3.0 → 0.3.1
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.
package/dist/index.js
CHANGED
|
@@ -3975,9 +3975,14 @@ class Ho {
|
|
|
3975
3975
|
}
|
|
3976
3976
|
/** 按当前可视区决定画布窗口位置。返回是否挪了窗口。 */
|
|
3977
3977
|
placeWindow(t, e) {
|
|
3978
|
-
var
|
|
3979
|
-
const n = this.visibleRange(t), i = Math.max(1, n.bottom - n.top), r = No / Math.max(1, Math.min(Mn, ((
|
|
3980
|
-
|
|
3978
|
+
var h;
|
|
3979
|
+
const n = this.visibleRange(t), i = Math.max(1, n.bottom - n.top), r = No / Math.max(1, Math.min(Mn, ((h = window.visualViewport) == null ? void 0 : h.scale) ?? 1)), o = Math.ceil(i + r * 2);
|
|
3980
|
+
if (o >= t.height) {
|
|
3981
|
+
const d = this.winTop !== 0 || this.winH !== t.height;
|
|
3982
|
+
return this.winTop = 0, this.winH = t.height, d;
|
|
3983
|
+
}
|
|
3984
|
+
const a = Math.max(0, t.height - o), l = this.winTop >= 0 && this.winTop <= a && this.winTop + this.winH <= t.height, c = n.top >= this.winTop && n.bottom <= this.winTop + this.winH;
|
|
3985
|
+
return !e && l && c && this.winH >= o ? !1 : (this.winTop = Math.min(a, Math.max(0, Math.floor(n.top - r))), this.winH = o, !0);
|
|
3981
3986
|
}
|
|
3982
3987
|
/** 滚动/窗口尺寸变化:可视区离开画布窗口时挪窗口并整体重画 */
|
|
3983
3988
|
followViewport() {
|