mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 20:13:52 +00:00
Changes to save some space and make the overlap not so large
This commit is contained in:
1 parent
dfe7204a3c
commit
39f04cbfc5
2 files changed
+5
-7
No files matched your search
+3
-3
@@ -30,7 +30,7 @@ public class CompetitorInfoOverlay extends CanvasOverlayV3 {
|
||||
private int canvasWidth;
|
||||
private int canvasHeight;
|
||||
private int infoBoxHeight;
|
||||
private int defaultInfoBoxHeight = 20;
|
||||
private int defaultInfoBoxHeight = 14;
|
||||
public static final int X_TEXT_COORDINATE = 8;
|
||||
public static final int Y_TEXT_COORDINATE = 14;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CompetitorInfoOverlay extends CanvasOverlayV3 {
|
||||
String[] textLines = infoText.split("\n");
|
||||
TextMetrics measureText = ctx.measureText(findLargestLine(textLines));
|
||||
double largestLineWidth = measureText.getWidth();
|
||||
infoBoxHeight = defaultInfoBoxHeight + textLines.length * 11;
|
||||
infoBoxHeight = defaultInfoBoxHeight + textLines.length * 10;
|
||||
canvasWidth = (int)largestLineWidth + infoBoxHeight;
|
||||
setCanvasSize(canvasWidth, canvasHeight);
|
||||
|
||||
@@ -128,7 +128,7 @@ public class CompetitorInfoOverlay extends CanvasOverlayV3 {
|
||||
|
||||
private void drawText(String[] lines, Context2d ctx) {
|
||||
for (int i = 0; i < lines.length; i++) {
|
||||
ctx.fillText(lines[i], X_TEXT_COORDINATE, Y_TEXT_COORDINATE + i * 15);
|
||||
ctx.fillText(lines[i], X_TEXT_COORDINATE, Y_TEXT_COORDINATE + i * 12);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -1946,10 +1946,8 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
|
||||
|
||||
private String createInfoText(CompetitorDTO competitorDTO, GPSFixDTOWithSpeedWindTackAndLegType gpsFixDTO) {
|
||||
StringBuilder infoText = new StringBuilder();
|
||||
infoText.append(competitorDTO.getName()).append(" (").append(competitorDTO.getSailID()).append(")")
|
||||
.append("\n");
|
||||
infoText.append(stringMessages.speed()).append(" : ")
|
||||
.append(NumberFormatterFactory.getDecimalFormat(1).format(gpsFixDTO.speedWithBearing.speedInKnots))
|
||||
infoText.append(competitorDTO.getSailID()).append("\n");
|
||||
infoText.append(NumberFormatterFactory.getDecimalFormat(1).format(gpsFixDTO.speedWithBearing.speedInKnots))
|
||||
.append(" ").append(stringMessages.knotsUnit()).append("\n");
|
||||
QuickRankDTO quickRankDTO = quickRanks.get(competitorDTO);
|
||||
if (quickRankDTO != null) {
|
||||
|
||||
Reference in new issue
Block a user