public class SafeTranslatedPath
extends android.graphics.Path
SafeTranslatedCanvas
to work around various Android issues with large canvases. For the two classes to work together,
call onDrawCycleStart(org.osmdroid.views.safecanvas.ISafeCanvas)
at the start of the Overlay#drawSafe
method of your
Overlay
. This will set the adjustment needed to draw your Path safely on the canvas
without any drawing distortion at high zoom levels. Methods of the Path
class that use
unsafe float types have been deprecated in favor of replacement methods that use doubles.ISafeCanvas}
Constructor and Description |
---|
SafeTranslatedPath() |
Modifier and Type | Method and Description |
---|---|
void |
addArc(android.graphics.RectF oval,
float startAngle,
float sweepAngle)
Deprecated.
|
void |
addArc(android.graphics.Rect oval,
float startAngle,
float sweepAngle) |
void |
addCircle(double x,
double y,
float radius,
android.graphics.Path.Direction dir) |
void |
addCircle(float x,
float y,
float radius,
android.graphics.Path.Direction dir)
Deprecated.
use
#addCircle(double, double, double, Direction) |
void |
addOval(android.graphics.RectF oval,
android.graphics.Path.Direction dir)
Deprecated.
use {@link #addOval(Rect, Direction)
|
void |
addOval(android.graphics.Rect oval,
android.graphics.Path.Direction dir) |
void |
addPath(android.graphics.Path src) |
void |
addPath(android.graphics.Path src,
float dx,
float dy) |
void |
addPath(android.graphics.Path src,
android.graphics.Matrix matrix) |
void |
addRect(double left,
double top,
double right,
double bottom,
android.graphics.Path.Direction dir) |
void |
addRect(float left,
float top,
float right,
float bottom,
android.graphics.Path.Direction dir)
Deprecated.
use
#addRect(double, double, double, double, Direction) |
void |
addRect(android.graphics.RectF rect,
android.graphics.Path.Direction dir)
Deprecated.
use
#addRect(Rect, Direction) |
void |
addRect(android.graphics.Rect rect,
android.graphics.Path.Direction dir) |
void |
addRoundRect(android.graphics.RectF rect,
float[] radii,
android.graphics.Path.Direction dir)
Deprecated.
use
#addRoundRect(Rect, float, Direction) |
void |
addRoundRect(android.graphics.RectF rect,
float rx,
float ry,
android.graphics.Path.Direction dir)
Deprecated.
use
#addRoundRect(Rect, float, float) |
void |
addRoundRect(android.graphics.Rect rect,
float[] radii,
android.graphics.Path.Direction dir) |
void |
addRoundRect(android.graphics.Rect rect,
float rx,
float ry,
android.graphics.Path.Direction dir) |
void |
arcTo(android.graphics.RectF oval,
float startAngle,
float sweepAngle)
Deprecated.
|
void |
arcTo(android.graphics.RectF oval,
float startAngle,
float sweepAngle,
boolean forceMoveTo)
Deprecated.
|
void |
arcTo(android.graphics.Rect oval,
float startAngle,
float sweepAngle) |
void |
arcTo(android.graphics.Rect oval,
float startAngle,
float sweepAngle,
boolean forceMoveTo) |
void |
close() |
void |
computeBounds(android.graphics.Rect bounds,
boolean exact) |
void |
computeBounds(android.graphics.RectF bounds,
boolean exact)
Deprecated.
Use
computeBounds(Rect, boolean) instead. |
void |
cubicTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3) |
void |
cubicTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Deprecated.
|
protected void |
finalize() |
android.graphics.Path.FillType |
getFillType() |
void |
incReserve(int extraPtCount) |
boolean |
isEmpty() |
boolean |
isInverseFillType() |
boolean |
isRect(android.graphics.Rect rect) |
boolean |
isRect(android.graphics.RectF rect)
Deprecated.
Use
isRect(Rect) instead. |
void |
lineTo(double x,
double y) |
void |
lineTo(float x,
float y)
Deprecated.
Use
lineTo(double, double) instead. |
void |
moveTo(double x,
double y) |
void |
moveTo(float x,
float y)
Deprecated.
Use
moveTo(double, double) instead. |
void |
offset(float dx,
float dy) |
void |
offset(float dx,
float dy,
android.graphics.Path dst) |
void |
onDrawCycleStart(ISafeCanvas canvas)
This method must be called at the start of the
Overlay#drawSafe draw cycle
method. |
void |
quadTo(double x1,
double y1,
double x2,
double y2) |
void |
quadTo(float x1,
float y1,
float x2,
float y2)
Deprecated.
Use
quadTo(double, double, double, double) instead. |
void |
rCubicTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3) |
void |
reset() |
void |
rewind() |
void |
rLineTo(float dx,
float dy) |
void |
rMoveTo(float dx,
float dy) |
void |
rQuadTo(float dx1,
float dy1,
float dx2,
float dy2) |
void |
set(android.graphics.Path src) |
void |
setFillType(android.graphics.Path.FillType ft) |
void |
setLastPoint(double dx,
double dy) |
void |
setLastPoint(float dx,
float dy)
Deprecated.
|
void |
toggleInverseFillType() |
protected android.graphics.RectF |
toOffsetRectF(android.graphics.Rect rect,
android.graphics.RectF reuse)
Helper function to convert a Rect to RectF and adjust the values of the Rect by the offsets.
|
void |
transform(android.graphics.Matrix matrix) |
void |
transform(android.graphics.Matrix matrix,
android.graphics.Path dst) |
public void onDrawCycleStart(ISafeCanvas canvas)
Overlay#drawSafe
draw cycle
method. This will adjust the Path to the current state of the ISafeCanvas
passed to
it.public void reset()
reset
in class android.graphics.Path
public void rewind()
rewind
in class android.graphics.Path
public void set(android.graphics.Path src)
set
in class android.graphics.Path
public android.graphics.Path.FillType getFillType()
getFillType
in class android.graphics.Path
public void setFillType(android.graphics.Path.FillType ft)
setFillType
in class android.graphics.Path
public boolean isInverseFillType()
isInverseFillType
in class android.graphics.Path
public void toggleInverseFillType()
toggleInverseFillType
in class android.graphics.Path
public boolean isEmpty()
isEmpty
in class android.graphics.Path
public boolean isRect(android.graphics.RectF rect)
isRect(Rect)
instead.isRect
in class android.graphics.Path
public boolean isRect(android.graphics.Rect rect)
#isRect(RectF)}
public void computeBounds(android.graphics.RectF bounds, boolean exact)
computeBounds(Rect, boolean)
instead.computeBounds
in class android.graphics.Path
public void computeBounds(android.graphics.Rect bounds, boolean exact)
#computeBounds(RectF, boolean)}
public void incReserve(int extraPtCount)
incReserve
in class android.graphics.Path
public void moveTo(float x, float y)
moveTo(double, double)
instead.moveTo
in class android.graphics.Path
public void moveTo(double x, double y)
#moveTo(float, float)}
public void rMoveTo(float dx, float dy)
rMoveTo
in class android.graphics.Path
public void lineTo(float x, float y)
lineTo(double, double)
instead.lineTo
in class android.graphics.Path
public void lineTo(double x, double y)
#lineTo(float, float)}
public void rLineTo(float dx, float dy)
rLineTo
in class android.graphics.Path
public void quadTo(float x1, float y1, float x2, float y2)
quadTo(double, double, double, double)
instead.quadTo
in class android.graphics.Path
public void quadTo(double x1, double y1, double x2, double y2)
#quadTo(float, float, float, float)}
public void rQuadTo(float dx1, float dy1, float dx2, float dy2)
rQuadTo
in class android.graphics.Path
public void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3)
cubicTo(double, double, double, double, double, double)
instead.cubicTo
in class android.graphics.Path
public void cubicTo(double x1, double y1, double x2, double y2, double x3, double y3)
#cubicTo(float, float, float, float, float, float)}
public void rCubicTo(float x1, float y1, float x2, float y2, float x3, float y3)
rCubicTo
in class android.graphics.Path
public void arcTo(android.graphics.RectF oval, float startAngle, float sweepAngle, boolean forceMoveTo)
arcTo(Rect, float, float, boolean)
arcTo
in class android.graphics.Path
public void arcTo(android.graphics.Rect oval, float startAngle, float sweepAngle, boolean forceMoveTo)
#arcTo(RectF, float, float, boolean)}
public void arcTo(android.graphics.RectF oval, float startAngle, float sweepAngle)
arcTo(Rect, float, float)
arcTo
in class android.graphics.Path
public void arcTo(android.graphics.Rect oval, float startAngle, float sweepAngle)
#arcTo(RectF, float, float)}
public void close()
close
in class android.graphics.Path
public void addRect(android.graphics.RectF rect, android.graphics.Path.Direction dir)
#addRect(Rect, Direction)
addRect
in class android.graphics.Path
public void addRect(android.graphics.Rect rect, android.graphics.Path.Direction dir)
#addRect(RectF, Direction)}
public void addRect(float left, float top, float right, float bottom, android.graphics.Path.Direction dir)
#addRect(double, double, double, double, Direction)
addRect
in class android.graphics.Path
public void addRect(double left, double top, double right, double bottom, android.graphics.Path.Direction dir)
#addRect(float, float, float, float, Direction)}
public void addOval(android.graphics.RectF oval, android.graphics.Path.Direction dir)
addOval
in class android.graphics.Path
public void addOval(android.graphics.Rect oval, android.graphics.Path.Direction dir)
#addOval(RectF, Direction)
public void addCircle(float x, float y, float radius, android.graphics.Path.Direction dir)
#addCircle(double, double, double, Direction)
addCircle
in class android.graphics.Path
public void addCircle(double x, double y, float radius, android.graphics.Path.Direction dir)
#addCircle(float, float, float, Direction)}
public void addArc(android.graphics.RectF oval, float startAngle, float sweepAngle)
addArc(Rect, float, float)
addArc
in class android.graphics.Path
public void addArc(android.graphics.Rect oval, float startAngle, float sweepAngle)
#addArc(RectF, float, float)}
public void addRoundRect(android.graphics.RectF rect, float rx, float ry, android.graphics.Path.Direction dir)
#addRoundRect(Rect, float, float)
addRoundRect
in class android.graphics.Path
public void addRoundRect(android.graphics.Rect rect, float rx, float ry, android.graphics.Path.Direction dir)
#addRoundRect(RectF, float, float)}
public void addRoundRect(android.graphics.RectF rect, float[] radii, android.graphics.Path.Direction dir)
#addRoundRect(Rect, float, Direction)
addRoundRect
in class android.graphics.Path
public void addRoundRect(android.graphics.Rect rect, float[] radii, android.graphics.Path.Direction dir)
#addRoundRect(RectF, float, Direction)}
public void addPath(android.graphics.Path src, float dx, float dy)
addPath
in class android.graphics.Path
public void addPath(android.graphics.Path src)
addPath
in class android.graphics.Path
public void addPath(android.graphics.Path src, android.graphics.Matrix matrix)
addPath
in class android.graphics.Path
public void offset(float dx, float dy, android.graphics.Path dst)
offset
in class android.graphics.Path
public void offset(float dx, float dy)
offset
in class android.graphics.Path
public void setLastPoint(float dx, float dy)
setLastPoint(double, double)
setLastPoint
in class android.graphics.Path
public void setLastPoint(double dx, double dy)
#setLastPoint(float, float)}
public void transform(android.graphics.Matrix matrix, android.graphics.Path dst)
transform
in class android.graphics.Path
public void transform(android.graphics.Matrix matrix)
transform
in class android.graphics.Path
protected void finalize() throws Throwable
finalize
in class android.graphics.Path
Throwable
protected final android.graphics.RectF toOffsetRectF(android.graphics.Rect rect, android.graphics.RectF reuse)
Copyright © 2014. All Rights Reserved.