AD title support for split mode

This commit is contained in:
Christian Colglazier 2022-01-17 13:42:46 -05:00
parent e6881fc906
commit eb9e4ad365
2 changed files with 7 additions and 3 deletions

View File

@ -119,7 +119,9 @@ ADDroplet::ADDroplet(DaisyPatch* m_patch,
GetTitleHeight()); GetTitleHeight());
} }
ADDroplet::~ADDroplet() {} ADDroplet::~ADDroplet() {
delete title_graph;
}
void ADDroplet::Control() { void ADDroplet::Control() {
if (Patch()->encoder.Pressed()) { if (Patch()->encoder.Pressed()) {
@ -194,7 +196,7 @@ void ADDroplet::Draw() {
title_graph->Update(); title_graph->Update();
} }
title_graph->SetPixelPercentage(ad[0].GetSignal()); title_graph->SetPixelPercentage(ad[0].GetSignal());
title_graph->Draw(Patch(), 0, 0); title_graph->Draw(Patch(), GetScreenMin(), 0);
DrawName("AD"); DrawName("AD");
AnimationInc(); AnimationInc();
@ -209,4 +211,6 @@ void ADDroplet::UpdateStateCallback() {
sample_rate, sample_rate,
State()); State());
} }
title_graph = new Graph(GetScreenMax()-GetScreenMin(),
GetTitleHeight());
} }

View File

@ -59,7 +59,7 @@ void Graph::Draw(DaisyPatch* patch, int x, int y) {
for (int w = 0; w < width; w++) { for (int w = 0; w < width; w++) {
for (int h = 0; h < height; h++) { for (int h = 0; h < height; h++) {
patch->display.DrawPixel(x+w, y+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)]); [GetShiftArray(height-h, height-1, height)]);
} }
} }