From f9f61911a77eaf8d2c803b66498d26a45c96d0ad Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Fri, 21 Apr 2017 23:07:48 +0200
Subject: [PATCH] fix Canvas drawing when bounds don't start at (0, 0)

---
 pixelgl/canvas.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pixelgl/canvas.go b/pixelgl/canvas.go
index 4bbf15e..7cd0ea4 100644
--- a/pixelgl/canvas.go
+++ b/pixelgl/canvas.go
@@ -145,8 +145,8 @@ func (c *Canvas) Smooth() bool {
 
 // must be manually called inside mainthread
 func (c *Canvas) setGlhfBounds() {
-	bx, by, bw, bh := intBounds(c.gf.Bounds())
-	glhf.Bounds(bx, by, bw, bh)
+	_, _, bw, bh := intBounds(c.gf.Bounds())
+	glhf.Bounds(0, 0, bw, bh)
 }
 
 // must be manually called inside mainthread
@@ -281,6 +281,7 @@ func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) {
 
 			ct.vs.Begin()
 			ct.vs.Draw()
+			fmt.Println(ct.vs.VertexData())
 			ct.vs.End()
 
 			tex.End()
-- 
GitLab