Skip to content

Commit 074afd0

Browse files
authored
Merge pull request #3592 from Ajayneethikannan/Shifting_methods_legacy.js
shift popMatrix, pushMatrix, printMatrix to legacy.js
2 parents dad707a + bca8cd2 commit 074afd0

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/core/legacy.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,20 @@ p5.prototype.popStyle = function() {
2020
throw new Error('popStyle() not used, see pop()');
2121
};
2222

23+
p5.prototype.popMatrix = function() {
24+
throw new Error('popMatrix() not used, see pop()');
25+
};
26+
27+
p5.prototype.printMatrix = function() {
28+
throw new Error(
29+
'printMatrix() is not implemented in p5.js, ' +
30+
'refer to [https://simonsarris.com/a-transformation-class-for-canvas-to-keep-track-of-the-transformation-matrix/] ' +
31+
'to add your own implementation.'
32+
);
33+
};
34+
35+
p5.prototype.pushMatrix = function() {
36+
throw new Error('pushMatrix() not used, see push()');
37+
};
38+
2339
module.exports = p5;

src/core/transform.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,6 @@ p5.prototype.applyMatrix = function(a, b, c, d, e, f) {
147147
return this;
148148
};
149149

150-
p5.prototype.popMatrix = function() {
151-
throw new Error('popMatrix() not used, see pop()');
152-
};
153-
154-
p5.prototype.printMatrix = function() {
155-
throw new Error('printMatrix() not implemented');
156-
};
157-
158-
p5.prototype.pushMatrix = function() {
159-
throw new Error('pushMatrix() not used, see push()');
160-
};
161-
162150
/**
163151
* Replaces the current matrix with the identity matrix.
164152
*

0 commit comments

Comments
 (0)