下面列出了android.graphics.Path#Direction ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public void addOval(Path path, float left, float top, float right, float bottom,
Path.Direction dir) {
final RectF oval = get();
oval.set(left, top, right, bottom);
path.addOval(oval, dir);
put(oval);
}
@Override
public void addRoundRect(Path path, float left, float top, float right, float bottom,
float rx, float ry, Path.Direction dir) {
final RectF rect = get();
rect.set(left, top, right, bottom);
path.addRoundRect(rect, rx, ry, dir);
put(rect);
}
@Override
public void addRoundRect(Path path, float left, float top, float right, float bottom,
float[] radii, Path.Direction dir) {
final RectF rect = get();
rect.set(left, top, right, bottom);
path.addRoundRect(rect, radii, dir);
put(rect);
}
@Override
public void addOval(Path path, float left, float top, float right, float bottom,
Path.Direction dir) {
final RectF oval = get();
oval.set(left, top, right, bottom);
path.addOval(oval, dir);
put(oval);
}
@Override
public void addRoundRect(Path path, float left, float top, float right, float bottom,
float rx, float ry, Path.Direction dir) {
final RectF rect = get();
rect.set(left, top, right, bottom);
path.addRoundRect(rect, rx, ry, dir);
put(rect);
}
static void addOval(Path path, float left, float top, float right, float bottom,
Path.Direction dir) {
IMPL.addOval(path, left, top, right, bottom, dir);
}
static void addRoundRect(Path path, float left, float top, float right, float bottom,
float rx, float ry, Path.Direction dir) {
IMPL.addRoundRect(path, left, top, right, bottom, rx, ry, dir);
}
static void addRoundRect(Path path, float left, float top, float right, float bottom,
float[] radii, Path.Direction dir) {
IMPL.addRoundRect(path, left, top, right, bottom, radii, dir);
}
void addOval(Path path, float left, float top, float right, float bottom,
Path.Direction dir);
void addRoundRect(Path path, float left, float top, float right, float bottom,
float rx, float ry, Path.Direction dir);
void addRoundRect(Path path, float left, float top, float right, float bottom,
float[] radii, Path.Direction dir);
@Override
public void addOval(Path path, float left, float top, float right, float bottom,
Path.Direction dir) {
path.addOval(left, top, right, bottom, dir);
}
@Override
public void addRoundRect(Path path, float left, float top, float right, float bottom,
float[] radii, Path.Direction dir) {
path.addRoundRect(left, top, right, bottom, radii, dir);
}
static void addOval(Path path, float left, float top, float right, float bottom,
Path.Direction dir) {
IMPL.addOval(path, left, top, right, bottom, dir);
}
@Override
public void addRoundRect(Path path, float left, float top, float right, float bottom,
float rx, float ry, Path.Direction dir) {
path.addRoundRect(left, top, right, bottom, rx, ry, dir);
}
void addOval(Path path, float left, float top, float right, float bottom,
Path.Direction dir);
/**
* Add a closed rectangle contour to the path
*
* @param left The left side of a rectangle to add to the path
* @param top The top of a rectangle to add to the path
* @param right The right side of a rectangle to add to the path
* @param bottom The bottom of a rectangle to add to the path
* @param dir The direction to wind the rectangle's contour
*/
public void addRect(float left, float top, float right, float bottom, Path.Direction dir) {
mPath.addRect(left, top, right, bottom, dir);
}
/**
* Add a closed oval contour to the path
*
* @param dir The direction to wind the oval's contour
*/
public void addOval(float left, float top, float right, float bottom, Path.Direction dir) {
Compat.addOval(mPath, left, top, right, bottom, dir);
}
/**
* Add a closed round-rectangle contour to the path
*
* @param rx The x-radius of the rounded corners on the round-rectangle
* @param ry The y-radius of the rounded corners on the round-rectangle
* @param dir The direction to wind the round-rectangle's contour
*/
public void addRoundRect(float left, float top, float right, float bottom, float rx, float ry,
Path.Direction dir) {
Compat.addRoundRect(mPath, left, top, right, bottom, rx, ry, dir);
}
/**
* Add a closed round-rectangle contour to the path. Each corner receives
* two radius values [X, Y]. The corners are ordered top-left, top-right,
* bottom-right, bottom-left
*
* @param radii Array of 8 values, 4 pairs of [X,Y] radii
* @param dir The direction to wind the round-rectangle's contour
*/
public void addRoundRect(float left, float top, float right, float bottom, float[] radii,
Path.Direction dir) {
Compat.addRoundRect(mPath, left, top, right, bottom, radii, dir);
}