Adjust graphs width.

This commit is contained in:
MAJigsaw77
2025-09-08 13:02:48 -04:00
committed by Eric
parent b5aed5fb4f
commit 477f85a71e
2 changed files with 13 additions and 5 deletions
+7 -3
View File
@@ -62,18 +62,22 @@ class FunkinDebugDisplay extends Sprite
background.graphics.endFill();
addChild(background);
fpsGraph = new FunkinStatsGraph(OTHERS_OFFSET, OTHERS_OFFSET + 22, 100, 25, color);
final graphsWidth:Int = OUTER_RECT_DIMENSIONS[0] + (INNER_RECT_DIFF * 2) - (OTHERS_OFFSET * 3);
final graphsHeight:Int = 25;
fpsGraph = new FunkinStatsGraph(OTHERS_OFFSET, OTHERS_OFFSET + 22, graphsWidth, graphsHeight, color);
fpsGraph.minValue = 0;
addChild(fpsGraph);
#if !html5
gcMemGraph = new FunkinStatsGraph(OTHERS_OFFSET, Math.floor(OTHERS_OFFSET + (fpsGraph.y + fpsGraph.axisHeight) + 22), 100, 25, color);
gcMemGraph = new FunkinStatsGraph(OTHERS_OFFSET, Math.floor(OTHERS_OFFSET + (fpsGraph.y + fpsGraph.axisHeight) + 22), graphsWidth, graphsHeight, color);
gcMemGraph.minValue = 0;
addChild(gcMemGraph);
if (MemoryUtil.supportsTaskMem())
{
taskMemGraph = new FunkinStatsGraph(OTHERS_OFFSET, Math.floor(OTHERS_OFFSET + (gcMemGraph.y + gcMemGraph.axisHeight) + 22), 100, 25, color);
taskMemGraph = new FunkinStatsGraph(OTHERS_OFFSET, Math.floor(OTHERS_OFFSET + (gcMemGraph.y + gcMemGraph.axisHeight) + 22), graphsWidth, graphsHeight,
color);
taskMemGraph.minValue = 0;
addChild(taskMemGraph);
}
@@ -60,18 +60,22 @@ class FunkinStatsGraph extends Sprite
function drawAxes():Void
{
axis.graphics.clear();
axis.graphics.lineStyle(1, AXIS_COLOR, AXIS_ALPHA, false, null, null, MITER, 255);
axis.graphics.moveTo(0, 0);
axis.graphics.lineTo(0, axisHeight);
axis.graphics.moveTo(0, axisHeight);
axis.graphics.lineTo(axisWidth, axisHeight);
}
function drawGraph():Void
{
graphics.clear();
graphics.lineStyle(1, graphColor, 1, false, null, null, MITER, 255);
if (history.length == 0)
@@ -87,9 +91,9 @@ class FunkinStatsGraph extends Sprite
{
final pointY:Float = axisHeight - ((history[i] - minValue) * scale) - 1;
if (i == 0) graphics.moveTo(axis.x + 1, pointY);
if (i == 0) graphics.moveTo(axis.x, pointY);
graphics.lineTo(axis.x + 1 + (i * inc), pointY);
graphics.lineTo(axis.x + (i * inc), pointY);
}
}