Merge pull request #9339 from ehermann/fix_arrow_size_simplified
FIX: rescale arrow if stroke is too large
This commit is contained in:
commit
9e6526ecbd
1 changed files with 7 additions and 1 deletions
|
@ -294,10 +294,16 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont
|
||||||
// int len = (int) (distSegment / pxStep);
|
// int len = (int) (distSegment / pxStep);
|
||||||
float pdx = x - px;
|
float pdx = x - px;
|
||||||
float pdy = y - py;
|
float pdy = y - py;
|
||||||
|
float scale = attrs.paint3.getStrokeWidth() / ( actionArrow.getWidth() / 2.25f);
|
||||||
|
float scaledWidth = actionArrow.getWidth();
|
||||||
matrix.reset();
|
matrix.reset();
|
||||||
matrix.postTranslate(0, -actionArrow.getHeight() / 2f);
|
matrix.postTranslate(0, -actionArrow.getHeight() / 2f);
|
||||||
matrix.postRotate((float) angle, actionArrow.getWidth() / 2f, 0);
|
matrix.postRotate((float) angle, actionArrow.getWidth() / 2f, 0);
|
||||||
matrix.postTranslate(px + pdx - actionArrow.getWidth() / 2f, py + pdy);
|
if (scale > 1.0f) {
|
||||||
|
matrix.postScale(scale, scale);
|
||||||
|
scaledWidth *= scale;
|
||||||
|
}
|
||||||
|
matrix.postTranslate(px + pdx - scaledWidth/ 2f, py + pdy);
|
||||||
canvas.drawBitmap(actionArrow, matrix, paintIconAction);
|
canvas.drawBitmap(actionArrow, matrix, paintIconAction);
|
||||||
} else {
|
} else {
|
||||||
px = x;
|
px = x;
|
||||||
|
|
Loading…
Reference in a new issue