mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2025-08-14 16:51:29 +08:00
pretty
This commit is contained in:
@ -5,23 +5,18 @@ export class Matrix {
|
||||
this.matrix = matrix;
|
||||
}
|
||||
|
||||
mmul = (matrix: Matrix): Matrix => {
|
||||
// prettier-ignore
|
||||
mmul(matrix: Matrix): Matrix {
|
||||
this.matrix = this.matrix.map((row, i) =>
|
||||
matrix.asArray()[0].map((_, j) =>
|
||||
row.reduce((acc, _, n) =>
|
||||
acc + this.matrix[i][n] * matrix.asArray()[n][j], 0
|
||||
)
|
||||
)
|
||||
);
|
||||
matrix.asArray()[0].map((_, j) => row.reduce((acc, _, n) => acc + this.matrix[i][n] * matrix.asArray()[n][j], 0))
|
||||
);
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
asArray = (): number[][] => {
|
||||
asArray(): number[][] {
|
||||
return this.matrix;
|
||||
};
|
||||
}
|
||||
|
||||
get = (rowIndex: number, columnIndex: number): number => {
|
||||
get(rowIndex: number, columnIndex: number): number {
|
||||
return this.asArray()[rowIndex][columnIndex];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ export abstract class AbstractDisplacementState<E extends CanvasEngine = CanvasE
|
||||
// If buttons is 0, it means the mouse is not down, the user may have released it
|
||||
// outside of the canvas, then we eject the state
|
||||
this.eject();
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user