If you think the Android project drive-android-svg listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.goodow.drive.android.svg.graphics;
//fromwww.java2s.comimport android.graphics.Path;
/**
* Created by liudenghui on 14-6-3.
*/publicclass MyRect extends MyBaseShape {
privateint x;
privateint y;
privateint width;
privateint height;
publicint getX() {
return x;
}
publicvoid setX(int x) {
this.x = x;
}
publicint getY() {
return y;
}
publicvoid setY(int y) {
this.y = y;
}
publicint getWidth() {
return width;
}
publicvoid setWidth(int width) {
this.width = width;
}
publicint getHeight() {
return height;
}
publicvoid setHeight(int height) {
this.height = height;
}
@Override
publicvoid generatePath() {
generatePath(x, y, width, height, rotate);
}
publicvoid generatePath(int x, int y, int width, int height, int rotate) {
path.reset();
path.addRect(x, y, x + width, y + height, Path.Direction.CW);
matrix.setRotate(rotate, x + width / 2, y + height / 2);
path.transform(matrix);
path.computeBounds(bounds, true);
}
}