From a56e137f805481d8325349825ec020dca64e225c Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 25 Jan 2022 00:43:07 +0000 Subject: [PATCH] Fix glBars for high-dpi/scale-factor systems Signed-off-by: falkTX --- plugins/Cardinal/src/HostMIDI.cpp | 2 +- plugins/Cardinal/src/glBars.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/Cardinal/src/HostMIDI.cpp b/plugins/Cardinal/src/HostMIDI.cpp index 6d3988a..a991a03 100644 --- a/plugins/Cardinal/src/HostMIDI.cpp +++ b/plugins/Cardinal/src/HostMIDI.cpp @@ -756,7 +756,7 @@ struct HostMIDIWidget : ModuleWidget { drawTextLine(args.vg, 2, "Velocity"); drawTextLine(args.vg, 3, "Aftertouch"); drawTextLine(args.vg, 4, "Pitchbend"); - drawTextLine(args.vg, 5, "Mod Wheel"); + drawTextLine(args.vg, 5, "ModWheel"); drawTextLine(args.vg, 6, "Start"); drawTextLine(args.vg, 7, "Stop"); drawTextLine(args.vg, 8, "Cont"); diff --git a/plugins/Cardinal/src/glBars.cpp b/plugins/Cardinal/src/glBars.cpp index 5f12cf9..1027dcb 100644 --- a/plugins/Cardinal/src/glBars.cpp +++ b/plugins/Cardinal/src/glBars.cpp @@ -67,7 +67,8 @@ struct glBarsRendererWidget : OpenGlWidget { glBarsRendererWidget(glBarsModule* const module) : glBars(module) { - oversample = 2.0f; + if (APP->window->pixelRatio < 2.0f) + oversample = 2.0f; } void drawFramebuffer() override { @@ -93,6 +94,12 @@ struct glBarsRendererWidget : OpenGlWidget { glPopMatrix(); glEnable(GL_BLEND); } + + void step() override { + OpenGlWidget::step(); + + oversample = APP->window->pixelRatio < 2.0f ? 2.0f : 1.0f; + } }; struct glBarsWidget : ModuleWidget {