Skip to content

Commit

Permalink
feat: Do not draw contextInfo on the status panel
Browse files Browse the repository at this point in the history
  • Loading branch information
tzebrowski committed Jul 17, 2024
1 parent 507b572 commit ff213db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ internal abstract class AbstractDrawer (context: Context, protected val settings
}
}

fun drawStatusPanel(canvas: Canvas, top: Float, left: Float, fps: Fps, metricsCollector: MetricsCollector? = null){
fun drawStatusPanel(canvas: Canvas, top: Float, left: Float, fps: Fps, metricsCollector: MetricsCollector? = null,
drawContextInfo: Boolean = false){

var text = statusLabel
var marginLeft = left
Expand Down Expand Up @@ -222,7 +223,7 @@ internal abstract class AbstractDrawer (context: Context, protected val settings
}

metricsCollector?.let {
if (settings.getDragRacingSettings().contextInfoEnabled) {
if (drawContextInfo) {
metricsCollector.getMetrics().firstOrNull { it.source.isAmbientTemp() }?.let {
marginLeft += getTextWidth(text, statusPaint) + 12F
text = ambientTempLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ internal class DragRacingSurfaceRenderer(
left += 5

if (settings.isStatusPanelEnabled()) {
dragRacingDrawer.drawStatusPanel(canvas, top, left, fps, metricsCollector)
dragRacingDrawer.drawStatusPanel(canvas, top, left, fps, metricsCollector, drawContextInfo = settings.getDragRacingSettings().contextInfoEnabled)
top += 4
dragRacingDrawer.drawDivider(canvas, left, area.width().toFloat(), top, Color.DKGRAY)
top += 40
Expand Down

0 comments on commit ff213db

Please sign in to comment.