mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-28 22:47:45 +00:00
Fix viewport resolutions on HiDpi displays
This commit is contained in:
parent
6ab6ad4732
commit
673a2bb6e0
1 changed files with 4 additions and 2 deletions
|
@ -39,7 +39,7 @@ public:
|
|||
m_initialized = true;
|
||||
|
||||
auto surface = m_instance->surfaceForWindow(this);
|
||||
if (!m_renderer->initSwapchain(surface, width(), height()))
|
||||
if (!m_renderer->initSwapchain(surface, width() * screen()->devicePixelRatio(), height() * screen()->devicePixelRatio()))
|
||||
m_initialized = false;
|
||||
else
|
||||
render();
|
||||
|
@ -56,7 +56,9 @@ public:
|
|||
case QEvent::Resize: {
|
||||
QResizeEvent *resizeEvent = (QResizeEvent *)e;
|
||||
auto surface = m_instance->surfaceForWindow(this);
|
||||
m_renderer->resize(surface, resizeEvent->size().width(), resizeEvent->size().height());
|
||||
m_renderer->resize(surface,
|
||||
resizeEvent->size().width() * screen()->devicePixelRatio(),
|
||||
resizeEvent->size().height() * screen()->devicePixelRatio());
|
||||
} break;
|
||||
case QEvent::MouseButtonPress: {
|
||||
auto mouseEvent = dynamic_cast<QMouseEvent *>(e);
|
||||
|
|
Loading…
Add table
Reference in a new issue