Skip to content

Commit 4e57296

Browse files
committed
Fixed error with order of PMatrix2D elements
1 parent 8083a44 commit 4e57296

4 files changed

Lines changed: 14 additions & 20 deletions

File tree

java/libraries/opengl/src/processing/opengl/LinePath.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ static public LinePath createStrokedPath(LinePath src, float weight,
392392
float miterlimit, PMatrix2D transform) {
393393
final LinePath dest = new LinePath();
394394

395-
// strokeTo(src, weight, caps, join, miterlimit, transform, new LineSink() {
396395
strokeTo(src, weight, caps, join, miterlimit, transform, new LineStroker() {
397396
public void moveTo(int x0, int y0) {
398397
dest.moveTo(S15_16ToFloat(x0), S15_16ToFloat(y0));
@@ -419,7 +418,6 @@ public void end() {
419418

420419
private static void strokeTo(LinePath src, float width, int caps, int join,
421420
float miterlimit, PMatrix2D transform,
422-
// LineSink lsink) {
423421
LineStroker lsink) {
424422
lsink = new LineStroker(lsink, FloatToS15_16(width), caps, join,
425423
FloatToS15_16(miterlimit),
@@ -430,7 +428,6 @@ private static void strokeTo(LinePath src, float width, int caps, int join,
430428
}
431429

432430

433-
// private static void pathTo(PathIterator pi, LineSink lsink) {
434431
private static void pathTo(PathIterator pi, LineStroker lsink) {
435432
float coords[] = new float[2];
436433
while (!pi.isDone()) {

java/libraries/opengl/src/processing/opengl/LineStroker.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727

2828
import processing.core.PMatrix2D;
2929

30-
public class LineStroker /*extends LineSink*/ {
31-
// private LineSink output;
30+
public class LineStroker {
3231
private LineStroker output;
3332
// private int lineWidth;
3433
private int capStyle;
@@ -88,7 +87,7 @@ public LineStroker() {
8887
* Constructs a <code>LineStroker</code>.
8988
*
9089
* @param output
91-
* an output <code>LineSink</code>.
90+
* an output <code>LineStroker</code>.
9291
* @param lineWidth
9392
* the desired line width in pixels, in S15.16 format.
9493
* @param capStyle
@@ -105,20 +104,18 @@ public LineStroker() {
105104
* required in order to produce consistently shaped end caps and
106105
* joins.
107106
*/
108-
// public LineStroker(LineSink output, int lineWidth, int capStyle, int joinStyle,
109107
public LineStroker(LineStroker output, int lineWidth, int capStyle, int joinStyle,
110108
int miterLimit, PMatrix2D transform) {
111109
setOutput(output);
112110
setParameters(lineWidth, capStyle, joinStyle, miterLimit, transform);
113111
}
114112

115113
/**
116-
* Sets the output <code>LineSink</code> of this <code>LineStroker</code>.
114+
* Sets the output <code>LineStroker</code> of this <code>LineStroker</code>.
117115
*
118116
* @param output
119-
* an output <code>LineSink</code>.
117+
* an output <code>LineStroker</code>.
120118
*/
121-
// public void setOutput(LineSink output) {
122119
public void setOutput(LineStroker output) {
123120
this.output = output;
124121
}

java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,19 +3424,19 @@ public void resetMatrix() {
34243424

34253425

34263426
public void applyMatrix(PMatrix2D source) {
3427-
applyMatrixImpl(source.m00, source.m01, source.m02, 0,
3428-
source.m10, source.m11, source.m12, 0,
3429-
0, 0, 1, 0,
3430-
0, 0, 0, 1);
3427+
applyMatrixImpl(source.m00, source.m01, 0, source.m02,
3428+
source.m10, source.m11, 0, source.m12,
3429+
0, 0, 1, 0,
3430+
0, 0, 0, 1);
34313431
}
34323432

34333433

34343434
public void applyMatrix(float n00, float n01, float n02,
34353435
float n10, float n11, float n12) {
3436-
applyMatrixImpl(n00, n01, n02, 0,
3437-
n10, n11, n12, 0,
3438-
0, 0, 1, 0,
3439-
0, 0, 0, 1);
3436+
applyMatrixImpl(n00, n01, 0, n02,
3437+
n10, n11, 0, n12,
3438+
0, 0, 1, 0,
3439+
0, 0, 0, 1);
34403440
}
34413441

34423442

java/libraries/opengl/src/processing/opengl/PShapeOpenGL.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,8 +1683,8 @@ public void scale(float x, float y, float z) {
16831683
public void applyMatrix(PMatrix2D source) {
16841684
transform(MATRIX, source.m00, source.m01, 0, source.m02,
16851685
source.m10, source.m11, 0, source.m12,
1686-
0, 0, 1, 0,
1687-
0, 0, 0, 1);
1686+
0, 0, 1, 0,
1687+
0, 0, 0, 1);
16881688
}
16891689

16901690

0 commit comments

Comments
 (0)