Skip to content
Snippets Groups Projects
Commit 30ea407b authored by Cory Quammen's avatar Cory Quammen
Browse files

Set VTK DPI in the render window set in QVTKOpenGLWidget

This improves chart font size (and ideally other chart element size)
on HiDPI displays.
parent 73fb094d
Branches
No related tags found
No related merge requests found
......@@ -377,6 +377,7 @@ void QVTKOpenGLWidget::requireRenderWindowInitialization()
if (this->RenderWindow)
{
this->RenderWindow->SetReadyForRendering(false);
this->markCachedImageAsDirty();
}
}
......@@ -428,6 +429,10 @@ void QVTKOpenGLWidget::paintGL()
f->glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &samples);
this->RenderWindow->SetMultiSamples(static_cast<int>(samples));
// Set the render window's DPI so that graphical elements in charts, etc.
// are not super tiny.
this->RenderWindow->SetDPI(this->devicePixelRatio() * this->physicalDpiX());
// On OsX (if QSurfaceFormat::alphaBufferSize() > 0) or when using Mesa, we
// end up rendering fully transparent windows (see through background)
// unless we fill it with alpha=1.0 (See paraview/paraview#17159).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment