public class DoodleShape extends Shape
限定符和类型 | 字段和说明 |
---|---|
boolean |
autoClosePath |
int |
index |
boolean |
isEnd |
boolean |
showCursorBitmap |
long |
timestamp |
dashType, hasAddedToPaintList, id, isHoverTrace, mPaint, number, rotateAngle, sendByUserName, sendByUserNumber, userRole
构造器和说明 |
---|
DoodleShape(Paint paint,
Paint fillPaint,
float angle) |
限定符和类型 | 方法和说明 |
---|---|
void |
appendPoint(LPPointF point) |
void |
copyShape(Shape shape) |
void |
disableHandWritingStyle() |
boolean |
equals(java.lang.Object obj) |
RectF |
getBoundary()
计算当前shape外接矩形范围
|
Paint |
getFillPaint() |
Paint |
getPaint() |
java.util.ArrayList<LPPointF> |
getPoints()
发送用点集
|
float |
getStrokeWidth()
获取paint初始线宽值
|
boolean |
isBoundaryOverlap(RectF rect)
shape外接矩形是否和输入矩形框相交
|
boolean |
isInBoundary(float x,
float y)
判断点击事件是否在shape外接矩形内
|
boolean |
isSmooth() |
boolean |
isTouchShape(float x,
float y)
是否点击到指定shape
|
boolean |
isValid()
图形是否有效.
|
void |
moveShapeBy(float deltaX,
float deltaY)
平移
|
void |
onDraw(Canvas canvas,
Matrix matrix)
绘制图形 在onDraw里调用 避免复杂的计算和内存分配
param canvas
|
void |
onDraw(Canvas canvas,
Matrix matrix,
ShapeRegionInfo regionInfo)
绘制图形
|
void |
reset() |
void |
scaleShapeBy(int scaleDir,
float scaleX,
float scaleY,
float offsetX,
float offsetY,
RectF boundaryRect,
boolean isMoreSelect)
scale shape to sourcePoint
|
void |
setAngle(float angle)
设置当前角度
|
void |
setCursorVectorDrawable(androidx.vectordrawable.graphics.drawable.VectorDrawableCompat vectorDrawable) |
void |
setPoints(java.util.ArrayList<LPPointF> points) |
void |
setSmooth(boolean smooth) |
void |
setSourcePoint(LPPointF sourcePoint) |
calcRotatePoint, copy, getIn_angle, getSourcePoint, setPaint
public boolean autoClosePath
public int index
public boolean isEnd
public boolean showCursorBitmap
public long timestamp
public void appendPoint(LPPointF point)
appendPoint
在类中 Shape
public void setPoints(java.util.ArrayList<LPPointF> points)
public void setSourcePoint(LPPointF sourcePoint)
setSourcePoint
在类中 Shape
public void reset()
public void onDraw(Canvas canvas, Matrix matrix)
Shape
public void onDraw(Canvas canvas, Matrix matrix, ShapeRegionInfo regionInfo)
Shape
public boolean isInBoundary(float x, float y)
isInBoundary
在类中 Shape
x
- rawXy
- rawYpublic boolean isTouchShape(float x, float y)
isTouchShape
在类中 Shape
x
- rawXy
- rawYpublic RectF getBoundary()
getBoundary
在类中 Shape
public Paint getFillPaint()
public void moveShapeBy(float deltaX, float deltaY)
moveShapeBy
在类中 Shape
deltaX
- x 轴 移动距离deltaY
- y 轴 移动距离public void scaleShapeBy(int scaleDir, float scaleX, float scaleY, float offsetX, float offsetY, RectF boundaryRect, boolean isMoreSelect)
Shape
scaleShapeBy
在类中 Shape
scaleDir
- scale directionscaleX
- X xiascaleY
- Y xiaoffsetX
- 缩放X轴相对原来中心点偏移量offsetY
- 缩放Y轴相对原来中心点偏移量boundaryRect
- 外接框范围isMoreSelect
- 是否多选缩放,需要处理旋转角度在90 ~ 270scaleDir置相反public boolean isBoundaryOverlap(RectF rect)
isBoundaryOverlap
在类中 Shape
rect
- public void setSmooth(boolean smooth)
public boolean isSmooth()
public void setAngle(float angle)
Shape
public float getStrokeWidth()
public void setCursorVectorDrawable(androidx.vectordrawable.graphics.drawable.VectorDrawableCompat vectorDrawable)
public void disableHandWritingStyle()