Browse Source

Call onZoom event when DPI is changed

tags/v0.5.0
Andrew Belt 7 years ago
parent
commit
e76f3c8392
2 changed files with 7 additions and 1 deletions
  1. +6
    -1
      src/gui.cpp
  2. +1
    -0
      src/widgets/FramebufferWidget.cpp

+ 6
- 1
src/gui.cpp View File

@@ -422,7 +422,12 @@ void guiRun() {
glfwGetFramebufferSize(gWindow, &width, &height);
int windowWidth, windowHeight;
glfwGetWindowSize(gWindow, &windowWidth, &windowHeight);
gPixelRatio = (float)width / windowWidth;
float pixelRatio = (float)width / windowWidth;
if (pixelRatio != gPixelRatio) {
EventZoom eZoom;
gScene->onZoom(eZoom);
gPixelRatio = pixelRatio;
}

// Step scene
gScene->step();


+ 1
- 0
src/widgets/FramebufferWidget.cpp View File

@@ -122,6 +122,7 @@ int FramebufferWidget::getImageHandle() {

void FramebufferWidget::onZoom(EventZoom &e) {
dirty = true;
Widget::onZoom(e);
}




Loading…
Cancel
Save