mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-14 16:11:47 -05:00
Proper OpenGL HiDPI handling. Fixes problems with size of OpenGL widgets on HiDPI screens. (PR #769)
This commit is contained in:
parent
3a08df72ad
commit
5c78738d33
@ -36,7 +36,7 @@ UITestCanvas::~UITestCanvas() = default;
|
||||
|
||||
void UITestCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
glContext->SetCurrent(*this);
|
||||
initGLExtensions();
|
||||
|
@ -48,7 +48,7 @@ GainCanvas::~GainCanvas() = default;
|
||||
|
||||
void GainCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
glContext->SetCurrent(*this);
|
||||
initGLExtensions();
|
||||
|
@ -81,7 +81,7 @@ void MeterCanvas::setShowUserInput(bool showUserInput_in) {
|
||||
|
||||
void MeterCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
glContext->SetCurrent(*this);
|
||||
initGLExtensions();
|
||||
|
@ -50,7 +50,7 @@ int ModeSelectorCanvas::getHoveredSelection() {
|
||||
|
||||
void ModeSelectorCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
glContext->SetCurrent(*this);
|
||||
initGLExtensions();
|
||||
|
@ -98,7 +98,7 @@ bool ScopeCanvas::getShowDb() const {
|
||||
|
||||
void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
ScopeRenderDataPtr avData;
|
||||
while (inputData->try_pop(avData)) {
|
||||
|
@ -49,7 +49,7 @@ SpectrumCanvas::~SpectrumCanvas() = default;
|
||||
|
||||
void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
SpectrumVisualDataPtr vData;
|
||||
if (visualDataQueue->try_pop(vData)) {
|
||||
|
@ -83,7 +83,7 @@ void TuningCanvas::setHalfBand(bool hb) {
|
||||
|
||||
void TuningCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
glContext->SetCurrent(*this);
|
||||
initGLExtensions();
|
||||
|
@ -129,7 +129,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
std::lock_guard < std::mutex > lock(tex_update);
|
||||
// wxPaintDC dc(this);
|
||||
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
long double currentZoom = zoom;
|
||||
|
||||
if (mouseZoom != 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user