mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +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();
|
||||
scanTarget->update(width(), height());
|
||||
scanTarget->draw(width(), height());
|
||||
const int devicePixelRatio = QPaintDevice::devicePixelRatio();
|
||||
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.
|
||||
vsyncPredictor.end_redraw();
|
||||
}
|
||||
@ -76,7 +79,8 @@ void ScanTargetWidget::vsync() {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user