提交 5a8f2736 编写于 作者: H huangziwei

rename

上级 aaa3245e
......@@ -4,7 +4,7 @@ import android.graphics.Canvas;
import android.graphics.Paint;
import static cn.hzw.graffiti.DrawUtil.drawCircle;
import static cn.hzw.graffiti.DrawUtil.rotatePointInGriffiti;
import static cn.hzw.graffiti.DrawUtil.rotatePointInGraffiti;
/**
* 仿制的定位器
......@@ -121,17 +121,17 @@ public class CopyLocation {
public void rotatePosition(int originalDegree, int mRotateDegree, float mOriginalPivotX, float mOriginalPivotY) {
// 旋转仿制图标的位置
float[] coords = rotatePointInGriffiti(mRotateDegree, originalDegree, this.mX,
float[] coords = rotatePointInGraffiti(mRotateDegree, originalDegree, this.mX,
this.mY, mOriginalPivotX, mOriginalPivotY);
this.mX = coords[0];
this.mY = coords[1];
coords = rotatePointInGriffiti(mRotateDegree, originalDegree, this.mCopyStartX,
coords = rotatePointInGraffiti(mRotateDegree, originalDegree, this.mCopyStartX,
this.mCopyStartY, mOriginalPivotX, mOriginalPivotY);
this.mCopyStartX = coords[0];
this.mCopyStartY = coords[1];
coords = rotatePointInGriffiti(mRotateDegree, originalDegree, this.mTouchStartX,
coords = rotatePointInGraffiti(mRotateDegree, originalDegree, this.mTouchStartX,
this.mTouchStartY, mOriginalPivotX, mOriginalPivotY);
this.mTouchStartX = coords[0];
this.mTouchStartY = coords[1];
......
......@@ -171,7 +171,7 @@ public class DrawUtil {
return coords;
}
public static float[] rotatePointInGriffiti(int nowDegree, int oldDegree, float x, float y, float mOriginalPivotX, float mOriginalPivotY) {
public static float[] rotatePointInGraffiti(int nowDegree, int oldDegree, float x, float y, float mOriginalPivotX, float mOriginalPivotY) {
int degree = nowDegree - oldDegree;
if (degree != 0) {
float px = mOriginalPivotX, py = mOriginalPivotY;
......@@ -182,8 +182,8 @@ public class DrawUtil {
}
float[] coords = rotatePoint(degree, x,
y, px, py);
if (Math.abs(degree) == 90 || Math.abs(degree) == 270) {
y, px, py); // 绕(px,py)旋转
if (Math.abs(degree) == 90 || Math.abs(degree) == 270) { // 偏移
coords[0] += (py - px);
coords[1] += -(py - px);
}
......@@ -204,4 +204,8 @@ public class DrawUtil {
public static void setGraffitiPixelUnit(float graffitiPixelUnit) {
DrawUtil.GRAFFITI_PIXEL_UNIT = graffitiPixelUnit;
}
public static void main(String[] args){
}
}
......@@ -4,7 +4,7 @@ import android.graphics.Matrix;
import android.graphics.Path;
import static cn.hzw.graffiti.DrawUtil.rotatePoint;
import static cn.hzw.graffiti.DrawUtil.rotatePointInGriffiti;
import static cn.hzw.graffiti.DrawUtil.rotatePointInGraffiti;
/**
* Created by huangziwei on 2017/3/16.
......@@ -48,12 +48,12 @@ public class GraffitiPath implements Undoable {
public float[] getDxDy(int currentDegree) {
return rotatePointInGriffiti(currentDegree, mRotateDegree, mDx, mDy, mPivotX, mPivotY);
return rotatePointInGraffiti(currentDegree, mRotateDegree, mDx, mDy, mPivotX, mPivotY);
}
public float[] getSxSy(int currentDegree) {
return rotatePointInGriffiti(currentDegree, mRotateDegree, mSx, mSy, mPivotX, mPivotY);
return rotatePointInGraffiti(currentDegree, mRotateDegree, mSx, mSy, mPivotX, mPivotY);
}
public Matrix getMatrix(int currentDegree) {
......
......@@ -63,7 +63,7 @@ public class GraffitiText implements Undoable {
}
public float[] getXy(int currentDegree) {
return rotatePointInGriffiti(currentDegree, mRotateDegree, mX, mY, mPivotX, mPivotY);
return rotatePointInGraffiti(currentDegree, mRotateDegree, mX, mY, mPivotX, mPivotY);
}
public void setText(String text) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册