/** * Fills the area outside the specificed rectangle with color. * This method is used to blank out areas that fall outside the map area. * * @param color the fill color for the outside area * @param insideArea the inside area on which not to draw */ void fillOutsideAreas(int color, Rectangle insideArea) { this.canvas.setClipDifference((int) insideArea.left, (int) insideArea.top, (int) insideArea.getWidth(), (int) insideArea.getHeight()); this.canvas.fillColor(color); this.canvas.resetClip(); }
/** * Fills the area outside the specificed rectangle with color. Use this method when * overpainting with a transparent color as it sets the PorterDuff mode. * This method is used to blank out areas that fall outside the map area. * * @param color the fill color for the outside area * @param insideArea the inside area on which not to draw */ void fillOutsideAreas(Color color, Rectangle insideArea) { this.canvas.setClipDifference((int) insideArea.left, (int) insideArea.top, (int) insideArea.getWidth(), (int) insideArea.getHeight()); this.canvas.fillColor(color); this.canvas.resetClip(); }
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();
/** * Fills the area outside the specificed rectangle with color. * This method is used to blank out areas that fall outside the map area. * * @param color the fill color for the outside area * @param insideArea the inside area on which not to draw */ void fillOutsideAreas(int color, Rectangle insideArea) { this.canvas.setClipDifference((int) insideArea.left, (int) insideArea.top, (int) insideArea.getWidth(), (int) insideArea.getHeight()); this.canvas.fillColor(color); this.canvas.resetClip(); }
/** * Fills the area outside the specificed rectangle with color. Use this method when * overpainting with a transparent color as it sets the PorterDuff mode. * This method is used to blank out areas that fall outside the map area. * * @param color the fill color for the outside area * @param insideArea the inside area on which not to draw */ void fillOutsideAreas(Color color, Rectangle insideArea) { this.canvas.setClipDifference((int) insideArea.left, (int) insideArea.top, (int) insideArea.getWidth(), (int) insideArea.getHeight()); this.canvas.fillColor(color); this.canvas.resetClip(); }
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(); } } }