From 6a04b701e4c7bb1ed09075ead052b348f3815051 Mon Sep 17 00:00:00 2001 From: "Oleg.Korshul" Date: Fri, 11 Jul 2014 12:19:04 +0000 Subject: [PATCH] retina support git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57284 954022d7-b5bf-4e40-9824-e11837661b57 --- .../Qt_build/editor/project/NativeControl.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DesktopEditor/Qt_build/editor/project/NativeControl.cpp b/DesktopEditor/Qt_build/editor/project/NativeControl.cpp index a71fe4988d..7064812f1c 100644 --- a/DesktopEditor/Qt_build/editor/project/NativeControl.cpp +++ b/DesktopEditor/Qt_build/editor/project/NativeControl.cpp @@ -149,8 +149,8 @@ void CNativeCtrl::paintGL() 1); glClear(GL_COLOR_BUFFER_BIT); - GLfloat _width = this->width(); - GLfloat _height = this->height(); + GLfloat _width = this->width() * this->devicePixelRatio(); + GLfloat _height = this->height() * this->devicePixelRatio(); glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -255,12 +255,12 @@ void CNativeCtrl::paintGL() FILE* file = fopen("/home/oleg/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents/DesktopEditor/log.txt", "a+"); fprintf(file, "time: %d\n", (int)(dwTime2 - dwTime1)); fclose(file); - */ } void CNativeCtrl::resizeGL(int width, int height) { - m_pWrapper->Resize(this->width(), this->height()); + int nDevicePixelRatio = this->devicePixelRatio(); + m_pWrapper->Resize(this->width() * nDevicePixelRatio, this->height() * nDevicePixelRatio); } void CNativeCtrl::closeEvent(QCloseEvent* e) @@ -271,8 +271,8 @@ void CNativeCtrl::closeEvent(QCloseEvent* e) void CNativeCtrl::mousePressEvent(QMouseEvent* e) { - m_pWrapper->m_oMouseController.X = e->pos().x(); - m_pWrapper->m_oMouseController.Y = e->pos().y(); + m_pWrapper->m_oMouseController.X = e->pos().x() * this->devicePixelRatio(); + m_pWrapper->m_oMouseController.Y = e->pos().y() * this->devicePixelRatio(); Qt::MouseButton button = e->button(); if (button == Qt::LeftButton) @@ -293,8 +293,8 @@ void CNativeCtrl::mousePressEvent(QMouseEvent* e) } void CNativeCtrl::mouseMoveEvent(QMouseEvent* e) { - m_pWrapper->m_oMouseController.X = e->pos().x(); - m_pWrapper->m_oMouseController.Y = e->pos().y(); + m_pWrapper->m_oMouseController.X = e->pos().x() * this->devicePixelRatio(); + m_pWrapper->m_oMouseController.Y = e->pos().y() * this->devicePixelRatio(); Qt::KeyboardModifiers mods = e->modifiers(); @@ -308,8 +308,8 @@ void CNativeCtrl::mouseMoveEvent(QMouseEvent* e) void CNativeCtrl::mouseReleaseEvent(QMouseEvent* e) { - m_pWrapper->m_oMouseController.X = e->pos().x(); - m_pWrapper->m_oMouseController.Y = e->pos().y(); + m_pWrapper->m_oMouseController.X = e->pos().x() * this->devicePixelRatio(); + m_pWrapper->m_oMouseController.Y = e->pos().y() * this->devicePixelRatio(); Qt::MouseButton button = e->button(); if (button == Qt::LeftButton)