Use tx, ty for translation rather than mx, my.
This commit is contained in:
@@ -174,12 +174,12 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
m10 = m01 = m02 = m12 = 0;
|
m10 = m01 = m02 = m12 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setToTranslation (double mx, double my) {
|
public void setToTranslation (double tx, double ty) {
|
||||||
m00 = m11 = 1f;
|
m00 = m11 = 1f;
|
||||||
m01 = m10 = 0;
|
m01 = m10 = 0;
|
||||||
m02 = mx;
|
m02 = tx;
|
||||||
m12 = my;
|
m12 = ty;
|
||||||
if (mx == 0 && my == 0) {
|
if (tx == 0 && ty == 0) {
|
||||||
type = TYPE_IDENTITY;
|
type = TYPE_IDENTITY;
|
||||||
} else {
|
} else {
|
||||||
type = TYPE_TRANSLATION;
|
type = TYPE_TRANSLATION;
|
||||||
@@ -233,9 +233,9 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
type = TYPE_UNKNOWN;
|
type = TYPE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AffineTransform getTranslateInstance (double mx, double my) {
|
public static AffineTransform getTranslateInstance (double tx, double ty) {
|
||||||
AffineTransform t = new AffineTransform();
|
AffineTransform t = new AffineTransform();
|
||||||
t.setToTranslation(mx, my);
|
t.setToTranslation(tx, ty);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,8 +263,8 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void translate (double mx, double my) {
|
public void translate (double tx, double ty) {
|
||||||
concatenate(getTranslateInstance(mx, my));
|
concatenate(getTranslateInstance(tx, ty));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void scale (double scx, double scy) {
|
public void scale (double scx, double scy) {
|
||||||
|
|||||||
@@ -172,12 +172,12 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
m10 = m01 = m02 = m12 = 0;
|
m10 = m01 = m02 = m12 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setToTranslation (float mx, float my) {
|
public void setToTranslation (float tx, float ty) {
|
||||||
m00 = m11 = 1f;
|
m00 = m11 = 1f;
|
||||||
m01 = m10 = 0;
|
m01 = m10 = 0;
|
||||||
m02 = mx;
|
m02 = tx;
|
||||||
m12 = my;
|
m12 = ty;
|
||||||
if (mx == 0 && my == 0) {
|
if (tx == 0 && ty == 0) {
|
||||||
type = TYPE_IDENTITY;
|
type = TYPE_IDENTITY;
|
||||||
} else {
|
} else {
|
||||||
type = TYPE_TRANSLATION;
|
type = TYPE_TRANSLATION;
|
||||||
@@ -231,9 +231,9 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
type = TYPE_UNKNOWN;
|
type = TYPE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AffineTransform getTranslateInstance (float mx, float my) {
|
public static AffineTransform getTranslateInstance (float tx, float ty) {
|
||||||
AffineTransform t = new AffineTransform();
|
AffineTransform t = new AffineTransform();
|
||||||
t.setToTranslation(mx, my);
|
t.setToTranslation(tx, ty);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,8 +261,8 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void translate (float mx, float my) {
|
public void translate (float tx, float ty) {
|
||||||
concatenate(getTranslateInstance(mx, my));
|
concatenate(getTranslateInstance(tx, ty));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void scale (float scx, float scy) {
|
public void scale (float scx, float scy) {
|
||||||
|
|||||||
Reference in New Issue
Block a user