Resolved the problem with Layer="-1" caused by PathEffect
This commit is contained in:
parent
8a32b94f21
commit
df0cfd3cb9
1 changed files with 156 additions and 134 deletions
|
@ -75,7 +75,6 @@ public class OsmandRenderer {
|
|||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public void fillProperties(RenderingContext rc, float centerX, float centerY){
|
||||
this.centerX = centerX + rc.textDx;
|
||||
this.centerY = centerY + rc.textDy;
|
||||
|
@ -156,6 +155,7 @@ public class OsmandRenderer {
|
|||
boolean textBold;
|
||||
int textShield = 0;
|
||||
int textOrder = -1;
|
||||
|
||||
String renderingDebugInfo;
|
||||
|
||||
RenderingPaintProperties main = new RenderingPaintProperties();
|
||||
|
@ -931,16 +931,38 @@ public class OsmandRenderer {
|
|||
}
|
||||
|
||||
private void drawPolylineWithShadow(Canvas canvas, Path path, int shadow, int shadowRadius, int index){
|
||||
// option shadow = 1 ,2 don't need any changes in first draw
|
||||
// option shadow = 0 without any shadows
|
||||
if(shadow == 0) paint.setShadowLayer(0, 0, 0, 0);
|
||||
//if(paint.getStrokeCap() == Paint.Cap.ROUND)paint.setStrokeCap(Paint.Cap.SQUARE);
|
||||
//if(paint.getStrokeCap() == Paint.Cap.ROUND)paint.setStrokeCap(Paint.Cap.BUTT);
|
||||
|
||||
if(paint.getPathEffect() != null){
|
||||
paint.setStrokeCap(Paint.Cap.BUTT);
|
||||
}
|
||||
|
||||
// no shadow
|
||||
if(shadow == 0){
|
||||
paint.setShadowLayer(0, 0, 0, 0);
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
//classic ugly shadows
|
||||
if(shadow == 1){
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
// blurred shadows
|
||||
if(shadow == 2){
|
||||
if(paint.getPathEffect() == null) paint.setColor(0xffffffff);
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
// option shadow = 3 with solid border
|
||||
if(shadow == 3){
|
||||
if(shadow == 3 && shadowRadius > 0){
|
||||
paint.setShadowLayer(0, 0, 0, 0);
|
||||
paint.setStrokeWidth(paint.getStrokeWidth() + 2);
|
||||
paint.setColor(0xffbababa);
|
||||
}
|
||||
if(paint.getPathEffect() == null) paint.setColor(0xffbababa);
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
|
||||
//check for shadow and save index in array
|
||||
if(shadowRadius > 0 && shadow > 1){
|
||||
|
|
Loading…
Reference in a new issue