@netless/forge-slide 1.1.5 → 1.2.0-beta.3
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/slide.esm.js +88 -68
- package/dist/slide.esm.js.map +2 -2
- package/dist/slide.js +88 -68
- package/dist/slide.js.map +2 -2
- package/package.json +3 -3
package/dist/slide.js
CHANGED
|
@@ -58615,7 +58615,7 @@ var require_lodash = __commonJS2({
|
|
|
58615
58615
|
result2.__values__ = wrapper.__values__;
|
|
58616
58616
|
return result2;
|
|
58617
58617
|
}
|
|
58618
|
-
function
|
|
58618
|
+
function chunk8(array, size2, guard) {
|
|
58619
58619
|
if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined2) {
|
|
58620
58620
|
size2 = 1;
|
|
58621
58621
|
} else {
|
|
@@ -60487,7 +60487,7 @@ var require_lodash = __commonJS2({
|
|
|
60487
60487
|
lodash.bindKey = bindKey;
|
|
60488
60488
|
lodash.castArray = castArray;
|
|
60489
60489
|
lodash.chain = chain;
|
|
60490
|
-
lodash.chunk =
|
|
60490
|
+
lodash.chunk = chunk8;
|
|
60491
60491
|
lodash.compact = compact;
|
|
60492
60492
|
lodash.concat = concat;
|
|
60493
60493
|
lodash.cond = cond;
|
|
@@ -60965,6 +60965,7 @@ var require_lodash = __commonJS2({
|
|
|
60965
60965
|
}
|
|
60966
60966
|
});
|
|
60967
60967
|
var import_paper = __toESM2(require_paper_full(), 1);
|
|
60968
|
+
var import_lodash = __toESM2(require_lodash(), 1);
|
|
60968
60969
|
function $(e, t, u, x = (h) => h) {
|
|
60969
60970
|
return e * x(0.5 - t * (0.5 - u));
|
|
60970
60971
|
}
|
|
@@ -61512,7 +61513,7 @@ var CurveModel = class extends ElementModel {
|
|
|
61512
61513
|
_defineProperty3(this, "debug", false);
|
|
61513
61514
|
_defineProperty3(this, "clearLocalPointsWhenYPointsChange", false);
|
|
61514
61515
|
_defineProperty3(this, "shouldUseLocalPoints", true);
|
|
61515
|
-
_defineProperty3(this, "localPointsPick",
|
|
61516
|
+
_defineProperty3(this, "localPointsPick", 4);
|
|
61516
61517
|
if (!this.root.doc || !this.root.has("type")) {
|
|
61517
61518
|
this.root.set("type", "curve");
|
|
61518
61519
|
}
|
|
@@ -61524,7 +61525,6 @@ var CurveModel = class extends ElementModel {
|
|
|
61524
61525
|
return (a2 + b2) / 2;
|
|
61525
61526
|
}
|
|
61526
61527
|
parsePoints(points) {
|
|
61527
|
-
const hasRealPressure = points.some((p) => p.length >= 3 && p[2] > 0);
|
|
61528
61528
|
const viewScale = this.scope.project.view.matrix.scaling.x || 1;
|
|
61529
61529
|
const taper = this.strokeWidth * 5 / viewScale;
|
|
61530
61530
|
const streamline = Math.min(0.7, 0.7 * viewScale);
|
|
@@ -61533,7 +61533,7 @@ var CurveModel = class extends ElementModel {
|
|
|
61533
61533
|
smoothing: 0.7,
|
|
61534
61534
|
thinning: 0.5,
|
|
61535
61535
|
streamline,
|
|
61536
|
-
simulatePressure:
|
|
61536
|
+
simulatePressure: true,
|
|
61537
61537
|
start: {
|
|
61538
61538
|
taper,
|
|
61539
61539
|
cap: true
|
|
@@ -61544,36 +61544,13 @@ var CurveModel = class extends ElementModel {
|
|
|
61544
61544
|
}
|
|
61545
61545
|
});
|
|
61546
61546
|
}
|
|
61547
|
-
isPressureValue(value) {
|
|
61548
|
-
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1;
|
|
61549
|
-
}
|
|
61550
|
-
pointStride(points) {
|
|
61551
|
-
if (points.length >= 3 && points.length % 3 === 0) {
|
|
61552
|
-
let hasPressureSlot = false;
|
|
61553
|
-
for (let i = 2; i < points.length; i += 3) {
|
|
61554
|
-
if (!this.isPressureValue(points[i])) {
|
|
61555
|
-
return 2;
|
|
61556
|
-
}
|
|
61557
|
-
hasPressureSlot = true;
|
|
61558
|
-
}
|
|
61559
|
-
if (hasPressureSlot) {
|
|
61560
|
-
return 3;
|
|
61561
|
-
}
|
|
61562
|
-
}
|
|
61563
|
-
return 2;
|
|
61564
|
-
}
|
|
61565
61547
|
matrixedPoints() {
|
|
61566
61548
|
const points = this.localPoints.length === 0 ? this.points : this.localPoints;
|
|
61567
61549
|
const matrix = new this.scope.Matrix(this.pointsMatrix);
|
|
61568
|
-
|
|
61569
|
-
|
|
61570
|
-
|
|
61571
|
-
|
|
61572
|
-
const tp = p.transform(matrix);
|
|
61573
|
-
const pressure = stride === 3 ? points[i + 2] ?? 0 : 0;
|
|
61574
|
-
output.push([tp.x, tp.y, pressure]);
|
|
61575
|
-
}
|
|
61576
|
-
return output;
|
|
61550
|
+
return (0, import_lodash.chunk)(points, 2).filter((point) => point.length === 2).map((_ref) => {
|
|
61551
|
+
let [x, y] = _ref;
|
|
61552
|
+
return new this.scope.Point(x, y).transform(matrix);
|
|
61553
|
+
}).map((point) => [point.x, point.y]);
|
|
61577
61554
|
}
|
|
61578
61555
|
createPath(points) {
|
|
61579
61556
|
const path = new this.scope.Path();
|
|
@@ -61647,12 +61624,11 @@ var CurveModel = class extends ElementModel {
|
|
|
61647
61624
|
liveCursorPoint() {
|
|
61648
61625
|
const yArray = this.root.get(ElementModel.KEYS.points);
|
|
61649
61626
|
const points = yArray.toArray();
|
|
61650
|
-
|
|
61651
|
-
if (points.length < stride) {
|
|
61627
|
+
if (points.length < 2) {
|
|
61652
61628
|
return null;
|
|
61653
61629
|
}
|
|
61654
61630
|
const len = points.length;
|
|
61655
|
-
const point = new this.scope.Point(points[len -
|
|
61631
|
+
const point = new this.scope.Point(points[len - 2], points[len - 1]);
|
|
61656
61632
|
return point.transform(new this.scope.Matrix(this.pointsMatrix));
|
|
61657
61633
|
}
|
|
61658
61634
|
onStyleKeyUpdate(key) {
|
|
@@ -61745,7 +61721,7 @@ var SelectorModel = class extends ElementModel {
|
|
|
61745
61721
|
onStyleKeyUpdate(_key) {
|
|
61746
61722
|
}
|
|
61747
61723
|
};
|
|
61748
|
-
var
|
|
61724
|
+
var import_lodash2 = __toESM2(require_lodash(), 1);
|
|
61749
61725
|
function _defineProperty5(e, r, t) {
|
|
61750
61726
|
return (r = _toPropertyKey5(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
61751
61727
|
}
|
|
@@ -61778,7 +61754,7 @@ function serializePath(path) {
|
|
|
61778
61754
|
}, []);
|
|
61779
61755
|
}
|
|
61780
61756
|
function deserializePath(points, scope, matrix) {
|
|
61781
|
-
const segmentGroup = (0,
|
|
61757
|
+
const segmentGroup = (0, import_lodash2.chunk)(points, 6);
|
|
61782
61758
|
const path = new scope.Path();
|
|
61783
61759
|
path.segments = segmentGroup.map((v) => deserializeSegment(v, scope, matrix));
|
|
61784
61760
|
return path;
|
|
@@ -61916,7 +61892,7 @@ var SegmentsModel = class extends ElementModel {
|
|
|
61916
61892
|
onStyleKeyUpdate(_key) {
|
|
61917
61893
|
}
|
|
61918
61894
|
};
|
|
61919
|
-
var
|
|
61895
|
+
var import_lodash4 = __toESM2(require_lodash(), 1);
|
|
61920
61896
|
function _defineProperty7(e, r, t) {
|
|
61921
61897
|
return (r = _toPropertyKey7(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
61922
61898
|
}
|
|
@@ -62011,7 +61987,7 @@ var WhiteboardTool = class {
|
|
|
62011
61987
|
this.tool.onMouseUp = this.onMouseUpSelf;
|
|
62012
61988
|
}
|
|
62013
61989
|
};
|
|
62014
|
-
var
|
|
61990
|
+
var import_lodash3 = __toESM2(require_lodash(), 1);
|
|
62015
61991
|
function _defineProperty8(e, r, t) {
|
|
62016
61992
|
return (r = _toPropertyKey8(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
62017
61993
|
}
|
|
@@ -62060,7 +62036,7 @@ var LineTool = class extends WhiteboardTool {
|
|
|
62060
62036
|
const point = path.getPointAt(distance);
|
|
62061
62037
|
return [point.x, point.y];
|
|
62062
62038
|
});
|
|
62063
|
-
this.elementModel.setPoints((0,
|
|
62039
|
+
this.elementModel.setPoints((0, import_lodash3.flattenDeep)(points));
|
|
62064
62040
|
}
|
|
62065
62041
|
}
|
|
62066
62042
|
onMouseUp(_event) {
|
|
@@ -62141,7 +62117,7 @@ var LineModel = class extends ElementModel {
|
|
|
62141
62117
|
}
|
|
62142
62118
|
renderLine() {
|
|
62143
62119
|
const matrix = new this.scope.Matrix(this.pointsMatrix);
|
|
62144
|
-
const papperPoints = (0,
|
|
62120
|
+
const papperPoints = (0, import_lodash4.chunk)(this.drawPoints, 2).map((item) => {
|
|
62145
62121
|
return new this.scope.Point(item[0], item[1]).transform(matrix);
|
|
62146
62122
|
});
|
|
62147
62123
|
const path = new this.scope.Path();
|
|
@@ -62277,7 +62253,7 @@ var LineControlPoint = class {
|
|
|
62277
62253
|
const invertedPoint = point.transform(pointsMatrix.inverted());
|
|
62278
62254
|
const points = this.model["drawPoints"];
|
|
62279
62255
|
this.position = invertedPoint;
|
|
62280
|
-
const clonedPoints = (0,
|
|
62256
|
+
const clonedPoints = (0, import_lodash4.cloneDeep)(points);
|
|
62281
62257
|
clonedPoints[this.options.index * 2] = invertedPoint.x;
|
|
62282
62258
|
clonedPoints[this.options.index * 2 + 1] = invertedPoint.y;
|
|
62283
62259
|
this.model.setPoints(clonedPoints);
|
|
@@ -62747,7 +62723,7 @@ var RectangleModel = class extends ElementModel {
|
|
|
62747
62723
|
}
|
|
62748
62724
|
};
|
|
62749
62725
|
var elementsUndoOrigin = "elementsUndoOrigin";
|
|
62750
|
-
var
|
|
62726
|
+
var import_lodash5 = __toESM2(require_lodash(), 1);
|
|
62751
62727
|
function _defineProperty13(e, r, t) {
|
|
62752
62728
|
return (r = _toPropertyKey13(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
62753
62729
|
}
|
|
@@ -62815,7 +62791,7 @@ var EraserModel = class extends ElementModel {
|
|
|
62815
62791
|
return path;
|
|
62816
62792
|
}
|
|
62817
62793
|
parsePoints(points) {
|
|
62818
|
-
const groupPoints = (0,
|
|
62794
|
+
const groupPoints = (0, import_lodash5.chunk)(points, 2);
|
|
62819
62795
|
return ae(groupPoints, {
|
|
62820
62796
|
size: this.strokeWidth,
|
|
62821
62797
|
smoothing: 0.5,
|
|
@@ -62833,7 +62809,7 @@ var EraserModel = class extends ElementModel {
|
|
|
62833
62809
|
});
|
|
62834
62810
|
}
|
|
62835
62811
|
matrixedPoints() {
|
|
62836
|
-
const currentPoints = (0,
|
|
62812
|
+
const currentPoints = (0, import_lodash5.chunk)(this.drawPoints, 2).slice(this.sliceBegin);
|
|
62837
62813
|
return currentPoints.map((_ref) => {
|
|
62838
62814
|
let [x, y] = _ref;
|
|
62839
62815
|
return new this.scope.Point(x, y);
|
|
@@ -62896,7 +62872,7 @@ var EraserModel = class extends ElementModel {
|
|
|
62896
62872
|
return point.transform(new this.scope.Matrix(this.pointsMatrix));
|
|
62897
62873
|
}
|
|
62898
62874
|
};
|
|
62899
|
-
var
|
|
62875
|
+
var import_lodash6 = __toESM2(require_lodash(), 1);
|
|
62900
62876
|
function _defineProperty14(e, r, t) {
|
|
62901
62877
|
return (r = _toPropertyKey14(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
62902
62878
|
}
|
|
@@ -63022,7 +62998,7 @@ var LaserPointerModel = class extends ElementModel {
|
|
|
63022
62998
|
const matrix = new this.scope.Matrix(this.pointsMatrix);
|
|
63023
62999
|
const points = this.cachedPoints || this.points;
|
|
63024
63000
|
console.log("[][][] ,", this.points.length, this.cachedPoints?.length, this.localPoints.length);
|
|
63025
|
-
const groupPoints = (0,
|
|
63001
|
+
const groupPoints = (0, import_lodash6.chunk)(points, 2).slice(this.sliceBegin);
|
|
63026
63002
|
return groupPoints.map((_ref) => {
|
|
63027
63003
|
let [x, y] = _ref;
|
|
63028
63004
|
return matrix.transform([x, y]);
|
|
@@ -63096,7 +63072,7 @@ var WhiteboardPermissions = class extends import_forge_room7.AbstractApplication
|
|
|
63096
63072
|
return [WhiteboardPermissionFlag.draw, WhiteboardPermissionFlag.editSelf, WhiteboardPermissionFlag.editOthers, WhiteboardPermissionFlag.deleteSelf, WhiteboardPermissionFlag.deleteOthers, WhiteboardPermissionFlag.mainView, WhiteboardPermissionFlag.setOthersView].filter((v) => (v & value) !== 0);
|
|
63097
63073
|
}
|
|
63098
63074
|
};
|
|
63099
|
-
var
|
|
63075
|
+
var import_lodash7 = __toESM2(require_lodash(), 1);
|
|
63100
63076
|
function _defineProperty15(e, r, t) {
|
|
63101
63077
|
return (r = _toPropertyKey15(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
63102
63078
|
}
|
|
@@ -63155,7 +63131,7 @@ var StraightLineModel = class extends ElementModel {
|
|
|
63155
63131
|
}
|
|
63156
63132
|
renderLine() {
|
|
63157
63133
|
const matrix = new this.scope.Matrix(this.pointsMatrix);
|
|
63158
|
-
const papperPoints = (0,
|
|
63134
|
+
const papperPoints = (0, import_lodash7.chunk)(this.drawPoints, 2).map((item) => {
|
|
63159
63135
|
return new this.scope.Point(item[0], item[1]).transform(matrix);
|
|
63160
63136
|
});
|
|
63161
63137
|
const path = new this.scope.Path();
|
|
@@ -63275,6 +63251,7 @@ var ImageModel = class extends ElementModel {
|
|
|
63275
63251
|
}
|
|
63276
63252
|
if (!this.imageSets.querySelector(`[id='${this.uuid}']`)) {
|
|
63277
63253
|
const img = document.createElement("img");
|
|
63254
|
+
img.crossOrigin = "anonymous";
|
|
63278
63255
|
img.src = this.src;
|
|
63279
63256
|
img.id = this.uuid;
|
|
63280
63257
|
this.imageSets.appendChild(img);
|
|
@@ -63479,14 +63456,55 @@ var RenderableModel = class extends import_eventemitter3.default {
|
|
|
63479
63456
|
const model = new ImageModel(yMap, this.scope, this.imageSets, this.liveCursor, this.isPerformanceMode);
|
|
63480
63457
|
model.bindObserver();
|
|
63481
63458
|
model.root.set("src", src);
|
|
63482
|
-
|
|
63459
|
+
model.ownerId = this.userManager.selfId;
|
|
63460
|
+
this.fitImageToViewport(src, model);
|
|
63461
|
+
}
|
|
63462
|
+
fitImageToViewport(src, model) {
|
|
63483
63463
|
const center = this.scope.project.view.center;
|
|
63484
|
-
|
|
63464
|
+
const fallbackMatrix = new this.scope.Matrix();
|
|
63465
|
+
fallbackMatrix.translate({
|
|
63485
63466
|
x: center.x,
|
|
63486
63467
|
y: center.y
|
|
63487
63468
|
});
|
|
63488
|
-
|
|
63489
|
-
|
|
63469
|
+
this.setElementPointsMatrix(model, fallbackMatrix);
|
|
63470
|
+
const img = document.createElement("img");
|
|
63471
|
+
img.crossOrigin = "anonymous";
|
|
63472
|
+
img.onload = () => {
|
|
63473
|
+
const naturalWidth = img.naturalWidth || img.width;
|
|
63474
|
+
const naturalHeight = img.naturalHeight || img.height;
|
|
63475
|
+
if (naturalWidth <= 0 || naturalHeight <= 0) {
|
|
63476
|
+
return;
|
|
63477
|
+
}
|
|
63478
|
+
const viewportBounds = this.scope.project.view.bounds;
|
|
63479
|
+
const maxWidth = viewportBounds.width * 2 / 3;
|
|
63480
|
+
const maxHeight = viewportBounds.height * 2 / 3;
|
|
63481
|
+
const fitScale = Math.min(maxWidth / naturalWidth, maxHeight / naturalHeight, 1);
|
|
63482
|
+
const nextMatrix = new this.scope.Matrix();
|
|
63483
|
+
nextMatrix.translate({
|
|
63484
|
+
x: center.x,
|
|
63485
|
+
y: center.y
|
|
63486
|
+
});
|
|
63487
|
+
if (fitScale > 0 && Number.isFinite(fitScale)) {
|
|
63488
|
+
nextMatrix.scale(fitScale);
|
|
63489
|
+
}
|
|
63490
|
+
this.setElementPointsMatrix(model, nextMatrix);
|
|
63491
|
+
};
|
|
63492
|
+
img.onerror = () => {
|
|
63493
|
+
(0, import_forge_room2.log)("[@netless/forge-whiteboard] failed to preload image for viewport fitting", {
|
|
63494
|
+
src
|
|
63495
|
+
}, "warn");
|
|
63496
|
+
};
|
|
63497
|
+
img.src = src;
|
|
63498
|
+
}
|
|
63499
|
+
setElementPointsMatrix(model, matrix) {
|
|
63500
|
+
const values = [matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty];
|
|
63501
|
+
if (model.root.doc) {
|
|
63502
|
+
model.root.doc.transact(() => {
|
|
63503
|
+
model.root.set(ElementModel.KEYS.pointsMatrix, values);
|
|
63504
|
+
}, elementsUndoOrigin);
|
|
63505
|
+
} else {
|
|
63506
|
+
model.root.set(ElementModel.KEYS.pointsMatrix, values);
|
|
63507
|
+
}
|
|
63490
63508
|
}
|
|
63491
63509
|
createCurve() {
|
|
63492
63510
|
let shadow = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
@@ -63743,7 +63761,7 @@ var RenderableModel = class extends import_eventemitter3.default {
|
|
|
63743
63761
|
if (shadow) {
|
|
63744
63762
|
yMap.set(ElementModel.KEYS.shadow, "layer");
|
|
63745
63763
|
}
|
|
63746
|
-
yMap.set(ElementModel.KEYS.points,
|
|
63764
|
+
yMap.set(ElementModel.KEYS.points, Y12.Array.from([x, y]));
|
|
63747
63765
|
yMap.set(ElementModel.KEYS.strokeWidth, this.toolbarModel.strokeWidth);
|
|
63748
63766
|
yMap.set(ElementModel.KEYS.strokeColor, this.toolbarModel.strokeColor);
|
|
63749
63767
|
yMap.set(ElementModel.KEYS.fillColor, this.toolbarModel.fillColor);
|
|
@@ -63751,7 +63769,6 @@ var RenderableModel = class extends import_eventemitter3.default {
|
|
|
63751
63769
|
this.elements.set(uuid, yMap);
|
|
63752
63770
|
}, elementsUndoOrigin);
|
|
63753
63771
|
pointTextModel.bindObserver();
|
|
63754
|
-
pointTextModel.setPoints([x, y]);
|
|
63755
63772
|
pointTextModel.fontSize = this.toolbarModel.fontSize;
|
|
63756
63773
|
pointTextModel.fontFamily = this.toolbarModel.fontFamily;
|
|
63757
63774
|
this.initElement(pointTextModel);
|
|
@@ -63783,7 +63800,7 @@ var RenderableModel = class extends import_eventemitter3.default {
|
|
|
63783
63800
|
});
|
|
63784
63801
|
}
|
|
63785
63802
|
};
|
|
63786
|
-
var
|
|
63803
|
+
var import_lodash8 = __toESM2(require_lodash(), 1);
|
|
63787
63804
|
function Point(x, y) {
|
|
63788
63805
|
this.X = x;
|
|
63789
63806
|
this.Y = y;
|
|
@@ -64026,7 +64043,7 @@ var Recognizer = class {
|
|
|
64026
64043
|
let maxX = -Number.MAX_VALUE;
|
|
64027
64044
|
let minY = Number.MAX_VALUE;
|
|
64028
64045
|
let maxY = -Number.MAX_VALUE;
|
|
64029
|
-
const result = this.dollar.Recognize((0,
|
|
64046
|
+
const result = this.dollar.Recognize((0, import_lodash8.chunk)(points, 2).map((v) => {
|
|
64030
64047
|
minX = Math.min(minX, v[0]);
|
|
64031
64048
|
maxX = Math.max(maxX, v[0]);
|
|
64032
64049
|
minY = Math.min(minY, v[1]);
|
|
@@ -64104,22 +64121,20 @@ var CurveTool = class extends WhiteboardTool {
|
|
|
64104
64121
|
if (this.elementModel) {
|
|
64105
64122
|
let lastX = 0;
|
|
64106
64123
|
let lastY = 0;
|
|
64107
|
-
if (this.pendingPoints.length >=
|
|
64108
|
-
lastX = this.pendingPoints[this.pendingPoints.length -
|
|
64109
|
-
lastY = this.pendingPoints[this.pendingPoints.length -
|
|
64124
|
+
if (this.pendingPoints.length >= 2) {
|
|
64125
|
+
lastX = this.pendingPoints[this.pendingPoints.length - 2];
|
|
64126
|
+
lastY = this.pendingPoints[this.pendingPoints.length - 1];
|
|
64110
64127
|
} else {
|
|
64111
64128
|
const len = this.elementModel.points.length;
|
|
64112
|
-
if (len >=
|
|
64113
|
-
lastX = this.elementModel.points[len -
|
|
64114
|
-
lastY = this.elementModel.points[len -
|
|
64129
|
+
if (len >= 2) {
|
|
64130
|
+
lastX = this.elementModel.points[len - 2];
|
|
64131
|
+
lastY = this.elementModel.points[len - 1];
|
|
64115
64132
|
}
|
|
64116
64133
|
}
|
|
64117
64134
|
const dist = Math.max(Math.abs(lastX - event.point.x), Math.abs(lastY - event.point.y));
|
|
64118
64135
|
if (dist >= MIN_DISTANCE) {
|
|
64119
64136
|
this.pointCount += 1;
|
|
64120
|
-
|
|
64121
|
-
const pressure = nativeEvent.pointerType === "pen" && nativeEvent.pressure > 0 ? nativeEvent.pressure : 0;
|
|
64122
|
-
this.pendingPoints.push(event.point.x, event.point.y, pressure);
|
|
64137
|
+
this.pendingPoints.push(event.point.x, event.point.y);
|
|
64123
64138
|
if (!this.flushRafId) {
|
|
64124
64139
|
this.flushRafId = requestAnimationFrame(this.flushPendingPoints);
|
|
64125
64140
|
}
|
|
@@ -68306,9 +68321,14 @@ var WhiteboardApplication = class _WhiteboardApplication extends import_forge_ro
|
|
|
68306
68321
|
this.snapshotScope.view.matrix.scale(scale, this.paperScope.project.view.bounds.topLeft);
|
|
68307
68322
|
this.snapshotScope.view.viewSize = this.paperScope.project.view.viewSize.clone().multiply(scale);
|
|
68308
68323
|
}
|
|
68309
|
-
return new Promise((resolve) => {
|
|
68324
|
+
return new Promise((resolve, reject) => {
|
|
68310
68325
|
setTimeout(() => {
|
|
68311
|
-
|
|
68326
|
+
try {
|
|
68327
|
+
const res = this.snapshotScope.view.element.toDataURL("image/png");
|
|
68328
|
+
resolve(res);
|
|
68329
|
+
} catch (error) {
|
|
68330
|
+
reject(error);
|
|
68331
|
+
}
|
|
68312
68332
|
}, 32);
|
|
68313
68333
|
});
|
|
68314
68334
|
}
|