From a2478b7faa7ad07d4fe0341897e9b6e7657aa92e Mon Sep 17 00:00:00 2001
From: Enrico Turri <enricoturri@seznam.cz>
Date: Wed, 6 Feb 2019 15:11:58 +0100
Subject: [PATCH] Fixed print bed UV mapping

---
 src/slic3r/GUI/GLCanvas3D.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp
index b204f9372..4a9faaaff 100644
--- a/src/slic3r/GUI/GLCanvas3D.cpp
+++ b/src/slic3r/GUI/GLCanvas3D.cpp
@@ -141,8 +141,8 @@ bool GeometryBuffer::set_from_triangles(const Polygons& triangles, float z, bool
             float inv_size_y = -1.0f / size_y;
             for (unsigned int i = 0; i < m_tex_coords.size(); i += 2)
             {
-                m_tex_coords[i] *= inv_size_x;
-                m_tex_coords[i + 1] *= inv_size_y;
+                m_tex_coords[i] = (m_tex_coords[i] - min_x) * inv_size_x;
+                m_tex_coords[i + 1] = (m_tex_coords[i + 1] - min_y) * inv_size_y;
             }
         }
     }