Pārlūkot izejas kodu

Fix HighDPI (Closes #3)

Johannes Kreutz 2 gadi atpakaļ
vecāks
revīzija
e163982183

+ 0 - 2
trackpoint-app/include/PickHandler.hpp

@@ -16,8 +16,6 @@ public:
   void setSelection(bool addNewPoints);
   void updateRenderer();
 
-//protected:
-
 private:
   osg::ref_ptr<osg::Switch> _selectionSwitch;
   osg::ref_ptr<osg::MatrixTransform> _selectionTranslateGroup;

+ 4 - 3
trackpoint-app/src/OSGWidget.cpp

@@ -176,8 +176,9 @@ void OSGWidget::paintGL() {
 }
 
 void OSGWidget::resizeGL(int width, int height) {
-  this->getEventQueue()->windowResize(this->x(), this->y(), width, height);
-  graphicsWindow_->resized(this->x(), this->y(), width, height);
+  auto pixelRatio = this->devicePixelRatio();
+  this->getEventQueue()->windowResize(this->x(), this->y(), width * pixelRatio, height * pixelRatio);
+  graphicsWindow_->resized(this->x(), this->y(), width * pixelRatio, height * pixelRatio);
 
   this->onResize(width, height);
 }
@@ -253,7 +254,7 @@ void OSGWidget::mouseReleaseEvent(QMouseEvent* event) {
 
   auto pixelRatio = this->devicePixelRatio();
 
-  this->getEventQueue()->mouseButtonRelease(static_cast<float>(pixelRatio * event->position().x()), static_cast<float>(pixelRatio * event->position().y()), button);
+  this->getEventQueue()->mouseButtonRelease(static_cast<float>(event->position().x() * pixelRatio), static_cast<float>(event->position().y() * pixelRatio), button);
 }
 
 void OSGWidget::wheelEvent(QWheelEvent* event) {

+ 3 - 0
trackpoint-app/src/TrackPointRenderer.cpp

@@ -45,6 +45,9 @@ void TrackPointRenderer::render(ActiveTrackingSystem activeTrackingSystem) {
     case SteamVRTrack: {
       break;
     }
+    case ActionPoints: {
+      break;
+    }
   }
   _osgWidget->update();
 }