@Override public synchronized void draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, Point topLeftPoint) { if (this.latLong == null || this.bitmap == null || this.bitmap.isDestroyed()) { return; } long mapSize = MercatorProjection.getMapSize(zoomLevel, this.displayModel.getTileSize()); double pixelX = MercatorProjection.longitudeToPixelX(this.latLong.longitude, mapSize); double pixelY = MercatorProjection.latitudeToPixelY(this.latLong.latitude, mapSize); int halfBitmapWidth = this.bitmap.getWidth() / 2; int halfBitmapHeight = this.bitmap.getHeight() / 2; int left = (int) (pixelX - topLeftPoint.x - halfBitmapWidth + this.horizontalOffset); int top = (int) (pixelY - topLeftPoint.y - halfBitmapHeight + this.verticalOffset); int right = left + this.bitmap.getWidth(); int bottom = top + this.bitmap.getHeight(); Rectangle bitmapRectangle = new Rectangle(left, top, right, bottom); Rectangle canvasRectangle = new Rectangle(0, 0, canvas.getWidth(), canvas.getHeight()); if (!canvasRectangle.intersects(bitmapRectangle)) { return; } canvas.drawBitmap(this.bitmap, left, top); }
canvas.drawLine(left, pixelY, right, pixelY, this.lineBack); canvas.drawLine(pixelX, bottom, pixelX, top, this.lineBack); canvas.drawLine(left, pixelY, right, pixelY, this.lineFront); canvas.drawLine(pixelX, bottom, pixelX, top, this.lineFront); int pixelX = (canvas.getWidth() - this.textFront.getTextWidth(text)) / 2; int pixelY = (int) (MercatorProjection.latitudeToPixelY(latitude, mapSize) - topLeftPoint.y) + this.textFront.getTextHeight(text) / 2; canvas.drawText(text, pixelX, pixelY, this.textBack); canvas.drawText(text, pixelX, pixelY, this.textFront); String text = convertCoordinate(longitude); int pixelX = (int) (MercatorProjection.longitudeToPixelX(longitude, mapSize) - topLeftPoint.x) - this.textFront.getTextWidth(text) / 2; int pixelY = (canvas.getHeight() + this.textFront.getTextHeight(text)) / 2; canvas.drawText(text, pixelX, pixelY, this.textBack); canvas.drawText(text, pixelX, pixelY, this.textFront);
public void destroy() { this.canvas.destroy(); }
static void mergeSameSized(HillshadingBitmap center, HillshadingBitmap neighbor, HillshadingBitmap.Border border, int padding, Canvas copyCanvas) { HillshadingBitmap sink; HillshadingBitmap source; if (border == HillshadingBitmap.Border.EAST) { sink = center; source = neighbor; copyCanvas.setBitmap(sink); copyCanvas.setClip(sink.getWidth() - padding, padding, padding, sink.getHeight() - 2 * padding); copyCanvas.drawBitmap(source, (source.getWidth() - 2 * padding), 0); } else if (border == HillshadingBitmap.Border.WEST) { sink = center; source = neighbor; copyCanvas.setBitmap(sink); copyCanvas.setClip(0, padding, padding, sink.getHeight() - 2 * padding); copyCanvas.drawBitmap(source, 2 * padding - (source.getWidth()), 0); } else if (border == HillshadingBitmap.Border.NORTH) { sink = center; source = neighbor; copyCanvas.setBitmap(sink); copyCanvas.setClip(padding, 0, sink.getWidth() - 2 * padding, padding); copyCanvas.drawBitmap(source, 0, 2 * padding - (source.getHeight())); } else if (border == HillshadingBitmap.Border.SOUTH) { sink = center; source = neighbor; copyCanvas.setBitmap(sink); copyCanvas.setClip(padding, sink.getHeight() - padding, sink.getWidth() - 2 * padding, padding); copyCanvas.drawBitmap(source, 0, (source.getHeight() - 2 * padding)); } }
case BOTTOM_CENTER: if (scaleBarLength2 == 0) { canvas.drawLine(Math.round((canvas.getWidth() - maxScaleBarLength) * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), Math.round((canvas.getWidth() + maxScaleBarLength) * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); canvas.drawLine(Math.round((canvas.getWidth() - maxScaleBarLength) * 0.5f), Math.round(canvas.getHeight() * 0.5f), Math.round((canvas.getWidth() - maxScaleBarLength) * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); canvas.drawLine(Math.round((canvas.getWidth() + maxScaleBarLength) * 0.5f), Math.round(canvas.getHeight() * 0.5f), Math.round((canvas.getWidth() + maxScaleBarLength) * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); } else { canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(canvas.getHeight() * 0.5f), Math.round(STROKE_EXTERNAL * scale * 0.5f + maxScaleBarLength), Math.round(canvas.getHeight() * 0.5f), paint); canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(SCALE_BAR_MARGIN * scale), Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f + scaleBarLength1), Math.round(SCALE_BAR_MARGIN * scale), Math.round(STROKE_EXTERNAL * scale * 0.5f + scaleBarLength1), Math.round(canvas.getHeight() * 0.5f), paint); canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f + scaleBarLength2), Math.round(canvas.getHeight() * 0.5f), Math.round(STROKE_EXTERNAL * scale * 0.5f + scaleBarLength2), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), Math.round(STROKE_EXTERNAL * scale * 0.5f + maxScaleBarLength), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(canvas.getHeight() * 0.5f), Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f + maxScaleBarLength), Math.round(canvas.getHeight() * 0.5f), Math.round(STROKE_EXTERNAL * scale * 0.5f + maxScaleBarLength), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint); } else { canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(canvas.getHeight() * 0.5f), Math.round(STROKE_EXTERNAL * scale * 0.5f + maxScaleBarLength), Math.round(canvas.getHeight() * 0.5f), paint); canvas.drawLine(Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(SCALE_BAR_MARGIN * scale), Math.round(STROKE_EXTERNAL * scale * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale), paint);
case BOTTOM_CENTER: if (scaleText2.length() == 0) { canvas.drawText(scaleText1, Math.round((canvas.getWidth() - this.paintScaleTextStroke.getTextWidth(scaleText1)) * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); } else { canvas.drawText(scaleText1, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); canvas.drawText(scaleText2, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText2)), paint); canvas.drawText(scaleText1, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); } else { canvas.drawText(scaleText1, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); canvas.drawText(scaleText2, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText2)), paint); canvas.drawText(scaleText1, Math.round(canvas.getWidth() - STROKE_EXTERNAL * scale - TEXT_MARGIN * scale - this.paintScaleTextStroke.getTextWidth(scaleText1)), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); } else { canvas.drawText(scaleText1, Math.round(canvas.getWidth() - STROKE_EXTERNAL * scale - TEXT_MARGIN * scale - this.paintScaleTextStroke.getTextWidth(scaleText1)), Math.round(canvas.getHeight() * 0.5f - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); canvas.drawText(scaleText2, Math.round(canvas.getWidth() - STROKE_EXTERNAL * scale - TEXT_MARGIN * scale - this.paintScaleTextStroke.getTextWidth(scaleText2)), Math.round(canvas.getHeight() * 0.5f + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText2)), paint); canvas.drawText(scaleText1, Math.round((canvas.getWidth() - this.paintScaleTextStroke.getTextWidth(scaleText1)) * 0.5f), Math.round(SCALE_BAR_MARGIN * scale + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText1)), paint); } else {
@Override public void draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, Point topLeftPoint) { if (this.getLatLong() == null || this.getBitmap() == null || this.getBitmap().isDestroyed()) { return; } long mapSize = MercatorProjection.getMapSize(zoomLevel, this.displayModel.getTileSize()); double pixelX = MercatorProjection.longitudeToPixelX(this.getLatLong().longitude, mapSize); double pixelY = MercatorProjection.latitudeToPixelY(this.getLatLong().latitude, mapSize); int halfBitmapWidth = this.getBitmap().getWidth() / 2; int halfBitmapHeight = this.getBitmap().getHeight() / 2; int left = (int) (pixelX - topLeftPoint.x - halfBitmapWidth + this.getHorizontalOffset()); int top = (int) (pixelY - topLeftPoint.y - halfBitmapHeight + this.getVerticalOffset()); int right = left + this.getBitmap().getWidth(); int bottom = top + this.getBitmap().getHeight(); Rectangle bitmapRectangle = new Rectangle(left, top, right, bottom); Rectangle canvasRectangle = new Rectangle(0, 0, canvas.getWidth(), canvas.getHeight()); if (!canvasRectangle.intersects(bitmapRectangle)) { return; } canvas.drawBitmap(this.getBitmap(), left, top); if (this.paintText != null) { String text = String.valueOf(this.children.size()); canvas.drawText(text, left + halfBitmapWidth - 5, top + halfBitmapHeight + 5, this.paintText); } }
Rectangle canvasRectangle = new Rectangle(0, 0, canvas.getWidth(), canvas.getHeight()); if (!canvasRectangle.intersects(bitmapRectangle)) { return; canvas.drawLine(left + halfBitmapWidth, top + this.getVerticalOffset() + halfBitmapHeight, leftGroup + groupBitmapHalfWidth, topGroup + groupVOffset + groupBitmapHalfHeight, this.polyPaintStroke); canvas.drawBitmap(this.getBitmap(), left, top);
private void drawParentTileBitmap(Canvas canvas, Point point, Tile tile) { Tile cachedParentTile = getCachedParentTile(tile, 4); if (cachedParentTile != null) { Bitmap bitmap = this.tileCache.getImmediately(createJob(cachedParentTile)); if (bitmap != null) { int tileSize = this.displayModel.getTileSize(); long translateX = tile.getShiftX(cachedParentTile) * tileSize; long translateY = tile.getShiftY(cachedParentTile) * tileSize; byte zoomLevelDiff = (byte) (tile.zoomLevel - cachedParentTile.zoomLevel); float scaleFactor = (float) Math.pow(2, zoomLevelDiff); int x = (int) Math.round(point.x); int y = (int) Math.round(point.y); this.matrix.reset(); this.matrix.translate(x - translateX, y - translateY); this.matrix.scale(scaleFactor, scaleFactor); canvas.setClip(x, y, this.displayModel.getTileSize(), this.displayModel.getTileSize()); canvas.drawBitmap(bitmap, this.matrix, this.displayModel.getFilter()); canvas.resetClip(); bitmap.decrementRefCount(); } } }
canvas.resetClip(); canvas.fillColor(this.displayModel.getBackgroundColor()); canvas.drawBitmap(bitmap, (int) Math.round(point.x), (int) Math.round(point.y), this.displayModel.getFilter()); bitmap.decrementRefCount();
Bitmap bitmap = frameBuffer.getDrawingBitmap(); if (bitmap != null) { this.drawingCanvas.setBitmap(bitmap); Dimension canvasDimension = this.drawingCanvas.getDimension(); int tileSize = this.mapView.getModel().displayModel.getTileSize(); BoundingBox boundingBox = MapPositionUtil.getBoundingBox(mapPosition, canvasDimension, tileSize);
@Override public synchronized void draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, Point topLeftPoint) { if (this.latLong == null || (this.paintStroke == null && this.paintFill == null)) { return; } double latitude = this.latLong.latitude; double longitude = this.latLong.longitude; long mapSize = MercatorProjection.getMapSize(zoomLevel, displayModel.getTileSize()); int pixelX = (int) (MercatorProjection.longitudeToPixelX(longitude, mapSize) - topLeftPoint.x); int pixelY = (int) (MercatorProjection.latitudeToPixelY(latitude, mapSize) - topLeftPoint.y); int radiusInPixel = getRadiusInPixels(latitude, zoomLevel); Rectangle canvasRectangle = new Rectangle(0, 0, canvas.getWidth(), canvas.getHeight()); if (!canvasRectangle.intersectsCircle(pixelX, pixelY, radiusInPixel)) { return; } if (this.paintStroke != null) { if (this.keepAligned) { this.paintStroke.setBitmapShaderShift(topLeftPoint); } canvas.drawCircle(pixelX, pixelY, radiusInPixel, this.paintStroke); } if (this.paintFill != null) { if (this.keepAligned) { this.paintFill.setBitmapShaderShift(topLeftPoint); } canvas.drawCircle(pixelX, pixelY, radiusInPixel, this.paintFill); } }
int x = (int) (tilePosition.point.x + (tile.tileSize - this.paintBack.getTextWidth(text)) / 2); int y = (int) (tilePosition.point.y + (tile.tileSize + this.paintBack.getTextHeight(text)) / 2); canvas.drawText(text, x, y, this.paintBack); canvas.drawText(text, x, y, this.paintFront); } else { int x = (int) (tilePosition.point.x + 8 * displayModel.getScaleFactor()); stringBuilder.append(tile.tileX); String text = stringBuilder.toString(); canvas.drawText(text, x, y, this.paintBack); canvas.drawText(text, x, y, this.paintFront); stringBuilder.append(tile.tileY); text = stringBuilder.toString(); canvas.drawText(text, x, (int) (y + 24 * displayModel.getScaleFactor()), this.paintBack); canvas.drawText(text, x, (int) (y + 24 * displayModel.getScaleFactor()), this.paintFront); stringBuilder.append(tile.zoomLevel); text = stringBuilder.toString(); canvas.drawText(text, x, (int) (y + 48 * displayModel.getScaleFactor()), this.paintBack); canvas.drawText(text, x, (int) (y + 48 * displayModel.getScaleFactor()), this.paintFront);
void setCanvasBitmap(Bitmap bitmap) { this.canvas.setBitmap(bitmap); }
@Override public void draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, Point topLeftPoint) { long tileLeft = MercatorProjection.longitudeToTileX(boundingBox.minLongitude, zoomLevel); long tileTop = MercatorProjection.latitudeToTileY(boundingBox.maxLatitude, zoomLevel); long tileRight = MercatorProjection.longitudeToTileX(boundingBox.maxLongitude, zoomLevel); long tileBottom = MercatorProjection.latitudeToTileY(boundingBox.minLatitude, zoomLevel); int tileSize = this.displayModel.getTileSize(); int pixelX1 = (int) (MercatorProjection.tileToPixel(tileLeft, tileSize) - topLeftPoint.x); int pixelY1 = (int) (MercatorProjection.tileToPixel(tileTop, tileSize) - topLeftPoint.y); int pixelX2 = (int) (MercatorProjection.tileToPixel(tileRight, tileSize) - topLeftPoint.x + tileSize); int pixelY2 = (int) (MercatorProjection.tileToPixel(tileBottom, tileSize) - topLeftPoint.y + tileSize); for (int lineX = pixelX1; lineX <= pixelX2 + 1; lineX += tileSize) { canvas.drawLine(lineX, pixelY1, lineX, pixelY2, this.paintBack); } for (int lineY = pixelY1; lineY <= pixelY2 + 1; lineY += tileSize) { canvas.drawLine(pixelX1, lineY, pixelX2, lineY, this.paintBack); } for (int lineX = pixelX1; lineX <= pixelX2 + 1; lineX += tileSize) { canvas.drawLine(lineX, pixelY1, lineX, pixelY2, this.paintFront); } for (int lineY = pixelY1; lineY <= pixelY2 + 1; lineY += tileSize) { canvas.drawLine(pixelX1, lineY, pixelX2, lineY, this.paintFront); } } }
@Override public void draw(Canvas canvas, Point origin, Matrix matrix, Filter filter) { matrix.reset(); // We cast to int for pixel perfect positioning matrix.translate((int) (this.xy.x - origin.x + boundary.left), (int) (this.xy.y - origin.y + boundary.top)); if (theta != 0 && alignCenter) { matrix.rotate(theta, (float) -boundary.left, (float) -boundary.top); } else { matrix.rotate(theta); } canvas.drawBitmap(this.symbol, matrix, filter); } }
private void drawPath(ShapePaintContainer shapePaintContainer, Point[][] coordinates, float dy) { this.path.clear(); for (Point[] innerList : coordinates) { Point[] points; if (dy != 0f) { points = RendererUtils.parallelPath(innerList, dy); } else { points = innerList; } if (points.length >= 2) { Point point = points[0]; this.path.moveTo((float) point.x, (float) point.y); for (int i = 1; i < points.length; ++i) { point = points[i]; this.path.lineTo((int) point.x, (int) point.y); } } } this.canvas.drawPath(this.path, shapePaintContainer.paint); }
private void drawCircleContainer(ShapePaintContainer shapePaintContainer) { CircleContainer circleContainer = (CircleContainer) shapePaintContainer.shapeContainer; Point point = circleContainer.point; this.canvas.drawCircle((int) point.x, (int) point.y, (int) circleContainer.radius, shapePaintContainer.paint); }
.getHeight()); Rectangle mBitmapRectangle = new Rectangle(left, top, right, bottom); Rectangle canvasRectangle = new Rectangle(0, 0, canvas.getWidth(), canvas.getHeight()); if (!canvasRectangle.intersects(mBitmapRectangle)) { return; canvas.drawBitmap(cluster.getClusterManager().markerIconBmps .get(markerType).getBitmap(isSelected), (int) left, (int) top); cluster.getClusterManager().markerIconBmps .get(markerType).getPaint()); canvas.drawBitmap(bubble, (int) (left + halfBitmapWidth - bubble.getWidth() / 2), (int) (top - bubble.getHeight())); + cluster.getClusterManager().markerIconBmps .get(markerType).getPaint().getTextHeight(cluster.getTitle()) / 2); canvas.drawText(cluster.getTitle(), x, y, cluster.getClusterManager().markerIconBmps .get(markerType).getPaint());
case BOTTOM_CENTER: if (scaleText2.length() == 0) { canvas.drawText(scaleText1, Math.round((canvas.getWidth() - this.paintScaleTextStroke.getTextWidth(scaleText1)) * 0.5f), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); } else { canvas.drawText(scaleText1, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); canvas.drawText(scaleText2, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText2)), paint); canvas.drawText(scaleText1, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); } else { canvas.drawText(scaleText1, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); canvas.drawText(scaleText2, Math.round(STROKE_EXTERNAL * scale + TEXT_MARGIN * scale), Math.round(canvas.getHeight() * 0.5f + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText2)), paint); canvas.drawText(scaleText1, Math.round(canvas.getWidth() - STROKE_EXTERNAL * scale - TEXT_MARGIN * scale - this.paintScaleTextStroke.getTextWidth(scaleText1)), Math.round(canvas.getHeight() - SCALE_BAR_MARGIN * scale - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); } else { canvas.drawText(scaleText1, Math.round(canvas.getWidth() - STROKE_EXTERNAL * scale - TEXT_MARGIN * scale - this.paintScaleTextStroke.getTextWidth(scaleText1)), Math.round(canvas.getHeight() * 0.5f - STROKE_EXTERNAL * scale * 0.5f - TEXT_MARGIN * scale), paint); canvas.drawText(scaleText2, Math.round(canvas.getWidth() - STROKE_EXTERNAL * scale - TEXT_MARGIN * scale - this.paintScaleTextStroke.getTextWidth(scaleText2)), Math.round(canvas.getHeight() * 0.5f + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText2)), paint); canvas.drawText(scaleText1, Math.round((canvas.getWidth() - this.paintScaleTextStroke.getTextWidth(scaleText1)) * 0.5f), Math.round(SCALE_BAR_MARGIN * scale + STROKE_EXTERNAL * scale * 0.5f + TEXT_MARGIN * scale + this.paintScaleTextStroke.getTextHeight(scaleText1)), paint); } else {