Fix: show failed record in result, ranking

This commit is contained in:
2019-09-27 08:26:23 +09:00
parent 301a057099
commit 963012978a
14 changed files with 180 additions and 17 deletions
+9 -1
View File
@@ -22,8 +22,11 @@ Chart.prototype.drawRecordGraph = function(index, date, bestRecord, min, max) {
return;
var recordTextPosY = posY - Chart.CHART_HEIGHT - Chart.CHART_RECORD_OFFSET_Y;
var absRecordValue = Math.abs(bestRecord);
// var absRecordValue = Math.abs(bestRecord);
var absRecordValue = bestRecord < 0 ? -1 * bestRecord : bestRecord;
// var absRecordValue = Math.abs(Math.floor(bestRecord));
var recordWithUnit = RecordUtil.getRecordValueWithUnit(absRecordValue, sessionStorageManager.getPlayingAppID());
if(bestRecord >= 0) {
this.drawText(posX, recordTextPosY, recordWithUnit);
} else {
@@ -38,9 +41,14 @@ Chart.prototype.drawRecordGraph = function(index, date, bestRecord, min, max) {
chartColor = 0xdddddd;
else
chartColor = 0xffaaaa;
if(max < absRecordValue)
max = absRecordValue * 1.1;
this.chartGraphics.lineStyle(50, chartColor, 1);
this.chartGraphics.moveTo(posX, posY);
this.chartGraphics.lineTo(posX, posY - Chart.CHART_HEIGHT * ( (absRecordValue - min) / (max - min) ));
console.log("absRecordValue : " + absRecordValue);
console.log("min : " + min);
console.log("max : " + max);
}
Chart.prototype.drawText = function(posX, posY, text) {