From 7c4ffa002347da6d6186864fb3716586328c4fe3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 27 May 2012 21:11:16 +0200 Subject: [PATCH] Fix issue rendering names --- OsmAnd/src/net/osmand/plus/render/TextRenderer.java | 3 +-- OsmAnd/src/net/osmand/plus/views/POIMapLayer.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java index bfbf4ee024..f1507e8ee1 100644 --- a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java @@ -26,7 +26,6 @@ import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Typeface; -import android.text.TextPaint; import android.util.FloatMath; public class TextRenderer { @@ -284,7 +283,7 @@ public class TextRenderer { } pos++; } - if (lastSpace == -1) { + if (lastSpace == -1 || pos == end) { drawTextOnCanvas(cv, text.text.substring(start, pos), text.centerX, text.centerY + line * (textSize + 2), paintText, text.textShadow); start = pos; diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 5fb6878f53..96ea97ea9e 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -253,7 +253,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon } pos++; } - if(lastSpace == -1){ + if(lastSpace == -1 || (pos == end)){ drawShadowText(cv, text.substring(start, pos), x, y + line * (textSize + 2)); start = pos; } else {