summary refs log tree commit diff
path: root/src/Util/ImageViewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Util/ImageViewer.cpp')
-rw-r--r--src/Util/ImageViewer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Util/ImageViewer.cpp b/src/Util/ImageViewer.cpp
index f94ccd0..9720408 100644
--- a/src/Util/ImageViewer.cpp
+++ b/src/Util/ImageViewer.cpp
@@ -20,7 +20,7 @@ ImageViewer::ImageViewer(
 
     model_uniform.set(Math::MVP::model({}, {}));
     view_uniform.set(Math::MVP::view({}, {}));
-    projection_uniform.set(Math::MVP::orthographic_projection(1000 * window_aspect, 1000, 0.0f, 100.0f));
+    projection_uniform.set(Math::MVP::orthographic_projection(view_size * window_aspect, view_size, 0.0f, 100.0f));
 
     m_program.unbind();
 }
@@ -37,12 +37,12 @@ void ImageViewer::render() const {
 
 GFX::Mesh ImageViewer::create_mesh(float window_aspect, uint32_t image_width, uint32_t image_height) {
     auto aspect = (float)image_width / image_height;
-    float max_size = 500.0f;
+    float max_size = view_size * 0.8f;
     float width = max_size * std::min(1.0f, aspect);
     float height = max_size * std::min(1.0f, 1/aspect);
 
-    float x = max_size * window_aspect - width / 2.0f;
-    float y = max_size - height / 2.0f;
+    float x = (view_size * window_aspect - width) / 2.0f;
+    float y = (view_size - height) / 2.0f;
 
     return {{
         std::vector<Vector<3>>{