Proper OpenGL HiDPI handling. Fixes problems with size of OpenGL widgets on HiDPI screens. (PR #769)

This commit is contained in:
Aleksey Makarenko 2019-11-12 21:19:13 +03:00 committed by vsonnier
parent 3a08df72ad
commit 5c78738d33
8 changed files with 8 additions and 8 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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)) {

View File

@ -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)) {

View File

@ -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();

View File

@ -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) {