void UpdateSceneView() { Vector2 newSize = graph.getSpriteSize(graph.gameObject); graph.changeSpriteSize(graph.graphBackground, Mathf.RoundToInt(newSize.x), Mathf.RoundToInt(newSize.y)); graph.changeSpritePositionToX(graph.graphBackground, -graph.paddingLeftRight.x); graph.changeSpritePositionToY(graph.graphBackground, -graph.paddingTopBottom.y); graph.UpdateBGandSeriesParentPositions(newSize.x, newSize.y); // Update axes lines int newX = Mathf.RoundToInt(newSize.x - graph.paddingLeftRight.x - graph.paddingLeftRight.y + graph.xAxis.AxisLinePadding); if (newX < 0) { newX = 0; } graph.changeSpriteSize(graph.xAxis.AxisLine, newX, graph.axisWidth); graph.changeSpritePositionToX(graph.xAxis.AxisLine, newX / 2f); int newY = Mathf.RoundToInt(newSize.y - graph.paddingTopBottom.x - graph.paddingTopBottom.y + graph.yAxis.AxisLinePadding); if (newY < 0) { newY = 0; } graph.changeSpriteSize(graph.yAxis.AxisLine, graph.axisWidth, newY); graph.changeSpritePositionToY(graph.yAxis.AxisLine, newY / 2f); }