mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-20 05:30:57 +01:00
rename some variables
This commit is contained in:
parent
e921b2bbb1
commit
717a629d09
@ -12,8 +12,8 @@ import android.view.View;
|
|||||||
public class MyCanvas extends View {
|
public class MyCanvas extends View {
|
||||||
private Paint paint;
|
private Paint paint;
|
||||||
private Path path;
|
private Path path;
|
||||||
private float startX;
|
private float curX;
|
||||||
private float startY;
|
private float curY;
|
||||||
|
|
||||||
public MyCanvas(Context context, AttributeSet attrs) {
|
public MyCanvas(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@ -33,18 +33,18 @@ public class MyCanvas extends View {
|
|||||||
|
|
||||||
private void actionDown(float x, float y) {
|
private void actionDown(float x, float y) {
|
||||||
path.moveTo(x, y);
|
path.moveTo(x, y);
|
||||||
startX = x;
|
curX = x;
|
||||||
startY = y;
|
curY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void actionMove(float x, float y) {
|
private void actionMove(float x, float y) {
|
||||||
path.quadTo(startX, startY, (x + startX) / 2, (y + startY) / 2);
|
path.quadTo(curX, curY, (x + curX) / 2, (y + curY) / 2);
|
||||||
startX = x;
|
curX = x;
|
||||||
startY = y;
|
curY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void actionUp() {
|
private void actionUp() {
|
||||||
path.lineTo(startX, startY);
|
path.lineTo(curX, curY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user