Fixed error with order of PMatrix2D elements

This commit is contained in:
codeanticode
2012-05-23 02:35:04 +00:00
parent 9663afe69c
commit 28bffbdd0b
4 changed files with 14 additions and 20 deletions
@@ -392,7 +392,6 @@ public class LinePath {
float miterlimit, PMatrix2D transform) {
final LinePath dest = new LinePath();
// strokeTo(src, weight, caps, join, miterlimit, transform, new LineSink() {
strokeTo(src, weight, caps, join, miterlimit, transform, new LineStroker() {
public void moveTo(int x0, int y0) {
dest.moveTo(S15_16ToFloat(x0), S15_16ToFloat(y0));
@@ -419,7 +418,6 @@ public class LinePath {
private static void strokeTo(LinePath src, float width, int caps, int join,
float miterlimit, PMatrix2D transform,
// LineSink lsink) {
LineStroker lsink) {
lsink = new LineStroker(lsink, FloatToS15_16(width), caps, join,
FloatToS15_16(miterlimit),
@@ -430,7 +428,6 @@ public class LinePath {
}
// private static void pathTo(PathIterator pi, LineSink lsink) {
private static void pathTo(PathIterator pi, LineStroker lsink) {
float coords[] = new float[2];
while (!pi.isDone()) {
@@ -27,8 +27,7 @@ package processing.opengl;
import processing.core.PMatrix2D;
public class LineStroker /*extends LineSink*/ {
// private LineSink output;
public class LineStroker {
private LineStroker output;
// private int lineWidth;
private int capStyle;
@@ -88,7 +87,7 @@ public class LineStroker /*extends LineSink*/ {
* Constructs a <code>LineStroker</code>.
*
* @param output
* an output <code>LineSink</code>.
* an output <code>LineStroker</code>.
* @param lineWidth
* the desired line width in pixels, in S15.16 format.
* @param capStyle
@@ -105,7 +104,6 @@ public class LineStroker /*extends LineSink*/ {
* required in order to produce consistently shaped end caps and
* joins.
*/
// public LineStroker(LineSink output, int lineWidth, int capStyle, int joinStyle,
public LineStroker(LineStroker output, int lineWidth, int capStyle, int joinStyle,
int miterLimit, PMatrix2D transform) {
setOutput(output);
@@ -113,12 +111,11 @@ public class LineStroker /*extends LineSink*/ {
}
/**
* Sets the output <code>LineSink</code> of this <code>LineStroker</code>.
* Sets the output <code>LineStroker</code> of this <code>LineStroker</code>.
*
* @param output
* an output <code>LineSink</code>.
* an output <code>LineStroker</code>.
*/
// public void setOutput(LineSink output) {
public void setOutput(LineStroker output) {
this.output = output;
}
@@ -3424,19 +3424,19 @@ public class PGraphicsOpenGL extends PGraphics {
public void applyMatrix(PMatrix2D source) {
applyMatrixImpl(source.m00, source.m01, source.m02, 0,
source.m10, source.m11, source.m12, 0,
0, 0, 1, 0,
0, 0, 0, 1);
applyMatrixImpl(source.m00, source.m01, 0, source.m02,
source.m10, source.m11, 0, source.m12,
0, 0, 1, 0,
0, 0, 0, 1);
}
public void applyMatrix(float n00, float n01, float n02,
float n10, float n11, float n12) {
applyMatrixImpl(n00, n01, n02, 0,
n10, n11, n12, 0,
0, 0, 1, 0,
0, 0, 0, 1);
applyMatrixImpl(n00, n01, 0, n02,
n10, n11, 0, n12,
0, 0, 1, 0,
0, 0, 0, 1);
}
@@ -1683,8 +1683,8 @@ public class PShapeOpenGL extends PShape {
public void applyMatrix(PMatrix2D source) {
transform(MATRIX, source.m00, source.m01, 0, source.m02,
source.m10, source.m11, 0, source.m12,
0, 0, 1, 0,
0, 0, 0, 1);
0, 0, 1, 0,
0, 0, 0, 1);
}