mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
Replace Array.prototype.find with simple for-loop
This commit is contained in:
@ -2144,9 +2144,15 @@ function (window, undefined) {
|
||||
}
|
||||
|
||||
if (AscFormat.isRealNumber(epsilon)) {
|
||||
const firstPointCommand = this.ArrPathCommand.find(function (command) {
|
||||
return command.id === AscFormat.moveTo || command.id === AscFormat.lineTo;
|
||||
});
|
||||
let firstPointCommand = null;
|
||||
for (let i = 0; i < this.ArrPathCommand.length; i++) {
|
||||
const command = this.ArrPathCommand[i];
|
||||
if (command.id === AscFormat.moveTo || command.id === AscFormat.lineTo) {
|
||||
firstPointCommand = command;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const firstPoint = firstPointCommand ? { x: firstPointCommand.X, y: firstPointCommand.Y } : null;
|
||||
const lastPoint = getPathEndPoint(this.ArrPathCommand);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user