From b2e0c1ab42136394c2844e48d31b8fce2a3d68be Mon Sep 17 00:00:00 2001
From: Guillaume Seguin <guillaume@segu.in>
Date: Mon, 1 Jul 2013 00:08:02 +0200
Subject: [PATCH] Use max of all dimensions instead of max of first 2

---
 lib/Slic3r/GUI/PreviewCanvas.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Slic3r/GUI/PreviewCanvas.pm b/lib/Slic3r/GUI/PreviewCanvas.pm
index 691080ae0..868843162 100644
--- a/lib/Slic3r/GUI/PreviewCanvas.pm
+++ b/lib/Slic3r/GUI/PreviewCanvas.pm
@@ -250,7 +250,7 @@ sub ResetModelView {
     glLoadIdentity();
     my $mesh_size = $self->mesh_size;
     my $win_size = $self->GetClientSize();
-    my $ratio = $factor * min($win_size->width, $win_size->height) / max(@$mesh_size[0..1]);
+    my $ratio = $factor * min($win_size->width, $win_size->height) / max(@$mesh_size);
     glScalef($ratio, $ratio, 1);
 }
 
@@ -266,7 +266,7 @@ sub Resize {
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
     my $mesh_size = $self->mesh_size;
-    glOrtho(-$x/2, $x/2, -$y/2, $y/2, 0.5, 2 * max(@$mesh_size[0..1]));
+    glOrtho(-$x/2, $x/2, -$y/2, $y/2, 0.5, 2 * max(@$mesh_size));
  
     glMatrixMode(GL_MODELVIEW);
     unless ($self->mview_init) {