From eb9e4ad365eeafb9526f1c38f7199eb0122bb59e Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Mon, 17 Jan 2022 13:42:46 -0500 Subject: [PATCH] AD title support for split mode --- src/droplets/ad_droplet.cpp | 8 ++++++-- src/graphics/graph.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/droplets/ad_droplet.cpp b/src/droplets/ad_droplet.cpp index 54802f9..707f283 100644 --- a/src/droplets/ad_droplet.cpp +++ b/src/droplets/ad_droplet.cpp @@ -119,7 +119,9 @@ ADDroplet::ADDroplet(DaisyPatch* m_patch, GetTitleHeight()); } -ADDroplet::~ADDroplet() {} +ADDroplet::~ADDroplet() { + delete title_graph; +} void ADDroplet::Control() { if (Patch()->encoder.Pressed()) { @@ -194,7 +196,7 @@ void ADDroplet::Draw() { title_graph->Update(); } title_graph->SetPixelPercentage(ad[0].GetSignal()); - title_graph->Draw(Patch(), 0, 0); + title_graph->Draw(Patch(), GetScreenMin(), 0); DrawName("AD"); AnimationInc(); @@ -209,4 +211,6 @@ void ADDroplet::UpdateStateCallback() { sample_rate, State()); } + title_graph = new Graph(GetScreenMax()-GetScreenMin(), + GetTitleHeight()); } diff --git a/src/graphics/graph.cpp b/src/graphics/graph.cpp index 3242f5b..9fe2f96 100644 --- a/src/graphics/graph.cpp +++ b/src/graphics/graph.cpp @@ -59,7 +59,7 @@ void Graph::Draw(DaisyPatch* patch, int x, int y) { for (int w = 0; w < width; w++) { for (int h = 0; h < height; h++) { patch->display.DrawPixel(x+w, y+h, - graph[GetShiftArray(width-w, active, width)] + graph[GetShiftArray(w, active+1, width)] [GetShiftArray(height-h, height-1, height)]); } }