From fd3327be9d6de51b0ff8255db392481e4993d357 Mon Sep 17 00:00:00 2001 From: Dorreen Rostami Date: Tue, 10 Oct 2023 22:49:48 -0400 Subject: [PATCH 1/3] Cast to float Casting 3 variables to float --- src/main/java/de/dennisguse/opentracks/chart/ChartView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/dennisguse/opentracks/chart/ChartView.java b/src/main/java/de/dennisguse/opentracks/chart/ChartView.java index a9ab2ce08..91d66020e 100644 --- a/src/main/java/de/dennisguse/opentracks/chart/ChartView.java +++ b/src/main/java/de/dennisguse/opentracks/chart/ChartView.java @@ -635,8 +635,8 @@ private void drawMarker(Canvas canvas) { } canvas.save(); float x = getX(getMarkerXValue(marker)); - canvas.drawLine(x, topBorder + spacer + markerHeight / 2, x, topBorder + effectiveHeight, markerPaint); - canvas.translate(x - (markerWidth * MARKER_X_ANCHOR), topBorder + spacer); + canvas.drawLine(x, topBorder + spacer + markerHeight / 2, x, float(topBorder) + effectiveHeight, markerPaint); + canvas.translate(x - (markerWidth * MARKER_X_ANCHOR), float(topBorder) + spacer); markerPin.draw(canvas); canvas.restore(); @@ -654,7 +654,7 @@ private void drawGrid(Canvas canvas) { List xAxisMarkerPositions = getXAxisMarkerPositions(getXAxisInterval()); for (double position : xAxisMarkerPositions) { int x = getX(position); - canvas.drawLine(x, topBorder, x, topBorder + effectiveHeight, gridPaint); + canvas.drawLine(x, topBorder, x, float(topBorder) + effectiveHeight, gridPaint); } // Y axis grid float rightEdge = getX(maxX); From 129b3a8b132c6a07abb1f139a1027cb5ba0975b7 Mon Sep 17 00:00:00 2001 From: Dorreen Rostami Date: Tue, 10 Oct 2023 23:09:28 -0400 Subject: [PATCH 2/3] cast to float corrected casting to float --- src/main/java/de/dennisguse/opentracks/chart/ChartView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/dennisguse/opentracks/chart/ChartView.java b/src/main/java/de/dennisguse/opentracks/chart/ChartView.java index 91d66020e..2399f86ca 100644 --- a/src/main/java/de/dennisguse/opentracks/chart/ChartView.java +++ b/src/main/java/de/dennisguse/opentracks/chart/ChartView.java @@ -635,8 +635,8 @@ private void drawMarker(Canvas canvas) { } canvas.save(); float x = getX(getMarkerXValue(marker)); - canvas.drawLine(x, topBorder + spacer + markerHeight / 2, x, float(topBorder) + effectiveHeight, markerPaint); - canvas.translate(x - (markerWidth * MARKER_X_ANCHOR), float(topBorder) + spacer); + canvas.drawLine(x, (float)(topBorder) + spacer + markerHeight / 2, x, (float)(topBorder) + effectiveHeight, markerPaint); + canvas.translate(x - (markerWidth * MARKER_X_ANCHOR), (float)(topBorder) + spacer); markerPin.draw(canvas); canvas.restore(); @@ -654,7 +654,7 @@ private void drawGrid(Canvas canvas) { List xAxisMarkerPositions = getXAxisMarkerPositions(getXAxisInterval()); for (double position : xAxisMarkerPositions) { int x = getX(position); - canvas.drawLine(x, topBorder, x, float(topBorder) + effectiveHeight, gridPaint); + canvas.drawLine(x, topBorder, x, (float)(topBorder) + effectiveHeight, gridPaint); } // Y axis grid float rightEdge = getX(maxX); From 8a37f5f6b4ab63615de67aee90d260c9d494f3a0 Mon Sep 17 00:00:00 2001 From: Dorreen Rostami Date: Wed, 11 Oct 2023 18:47:56 -0400 Subject: [PATCH 3/3] casting to float --- src/main/java/de/dennisguse/opentracks/chart/ChartView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/dennisguse/opentracks/chart/ChartView.java b/src/main/java/de/dennisguse/opentracks/chart/ChartView.java index d51155444..ecd3fcd30 100644 --- a/src/main/java/de/dennisguse/opentracks/chart/ChartView.java +++ b/src/main/java/de/dennisguse/opentracks/chart/ChartView.java @@ -636,7 +636,7 @@ private void drawMarker(Canvas canvas) { canvas.save(); float x = getX(getMarkerXValue(marker)); canvas.drawLine(x, (float)(topBorder) + spacer + markerHeight / 2, x, (float)(topBorder) + effectiveHeight, markerPaint); - canvas.translate(x - (markerWidth * MARKER_X_ANCHOR), (float)(topBorder) + spacer); + canvas.translate(x - (markerWidth * MARKER_X_ANCHOR), (float)(topBorder + spacer)); markerPin.draw(canvas); canvas.restore();