From 7feecc2e358abc69bb2540b4e4a41726d17a695f Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Tue, 7 Mar 2017 01:06:37 +0100
Subject: [PATCH] correct glhf.Bounds in Canvas

---
 pixelgl/canvas.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pixelgl/canvas.go b/pixelgl/canvas.go
index 3d926d7..4d45592 100644
--- a/pixelgl/canvas.go
+++ b/pixelgl/canvas.go
@@ -209,7 +209,11 @@ func (ct *canvasTriangles) draw(cp *canvasPicture) {
 	col := ct.c.col
 
 	mainthread.CallNonBlock(func() {
-		glhf.Bounds(0, 0, ct.c.f.Width(), ct.c.f.Height())
+		bounds := ct.c.bounds
+		bounds.Pos -= ct.c.borders.Pos
+		bx, by, bw, bh := discreteBounds(bounds)
+		glhf.Bounds(bx, by, bw, bh)
+
 		ct.c.f.Begin()
 		ct.c.s.Begin()
 
-- 
GitLab