mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-17 13:29:02 +00:00
Ensures proper output sizeing on HiDPI displays.
This commit is contained in:
parent
387500f01a
commit
3c896050fb
@ -52,8 +52,11 @@ void ScanTargetWidget::paintGL() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vsyncPredictor.begin_redraw();
|
vsyncPredictor.begin_redraw();
|
||||||
scanTarget->update(width(), height());
|
const int devicePixelRatio = QPaintDevice::devicePixelRatio();
|
||||||
scanTarget->draw(width(), height());
|
const int outputWidth = width()*devicePixelRatio;
|
||||||
|
const int outputHeight = height()*devicePixelRatio;
|
||||||
|
scanTarget->update(outputWidth, outputHeight);
|
||||||
|
scanTarget->draw(outputWidth, outputHeight);
|
||||||
glFinish(); // Make sure all costs are properly accounted for in the vsync predictor.
|
glFinish(); // Make sure all costs are properly accounted for in the vsync predictor.
|
||||||
vsyncPredictor.end_redraw();
|
vsyncPredictor.end_redraw();
|
||||||
}
|
}
|
||||||
@ -76,7 +79,8 @@ void ScanTargetWidget::vsync() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScanTargetWidget::resizeGL(int w, int h) {
|
void ScanTargetWidget::resizeGL(int w, int h) {
|
||||||
glViewport(0, 0, w, h);
|
const int devicePixelRatio = QPaintDevice::devicePixelRatio();
|
||||||
|
glViewport(0, 0, w*devicePixelRatio, h*devicePixelRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScanTargetWidget::setScanProducer(MachineTypes::ScanProducer *producer) {
|
void ScanTargetWidget::setScanProducer(MachineTypes::ScanProducer *producer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user