| | |
| | | |
| | | Path path = new Path(); |
| | | Log.i(TAG, "DrawMap: map.length:"+map.length); |
| | | if (map.length != 9) { |
| | | if (map.length < 9) { |
| | | Log.d(TAG, "DrawMap X = " + String.format("%f", (float) (base_x + (map[0][0] - min_x) * scale_x)) + " Y = " + String.format("%f", (float) (base_y + (map[0][1] - min_y) * scale_y))); |
| | | path.moveTo((float) (base_x + (map[0][0] - min_x) * scale_x), (float) (base_y + (map[0][1] - min_y) * scale_y)); |
| | | for (int i = 1; i < map.length; i++) { |
| | |
| | | path.lineTo((float) (base_x + (map[i][0] - min_x) * scale_x), (float) (base_y + (map[i][1] - min_y) * scale_y)); |
| | | } |
| | | path.close(); |
| | | } else { |
| | | } else if (map.length == 9) { |
| | | path.moveTo((float) (base_x + (map[0][0] - min_x) * scale_x), (float) (base_y + (map[0][1] - min_y) * scale_y)); |
| | | path.lineTo((float) (base_x + (map[8][0] - min_x) * scale_x), (float) (base_y + (map[8][1] - min_y) * scale_y)); |
| | | |
| | |
| | | |
| | | path.moveTo((float) (base_x + (map[7][0] - min_x) * scale_x), (float) (base_y + (map[7][1] - min_y) * scale_y)); |
| | | path.lineTo((float) (base_x + (map[8][0] - min_x) * scale_x), (float) (base_y + (map[8][1] - min_y) * scale_y)); |
| | | } else { |
| | | path.moveTo((float) (base_x + (map[0][0] - min_x) * scale_x), (float) (base_y + (map[0][1] - min_y) * scale_y)); |
| | | for (int i = 1; i < map.length; i++) { |
| | | path.lineTo((float) (base_x + (map[i][0] - min_x) * scale_x), (float) (base_y + (map[i][1] - min_y) * scale_y)); |
| | | } |
| | | } |
| | | canvas2.drawPath(path, paint); |
| | | |