Moved triangle clipping to the proper location

This commit is contained in:
Allen Ray 2020-06-21 22:54:23 -04:00
parent e79a8c37e6
commit c3e5e4fdb2
1 changed files with 4 additions and 3 deletions

View File

@ -315,6 +315,10 @@ func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) {
ct.dst.shader.s.SetUniformAttr(loc, u.Value())
}
if clip, has := ct.ClipRect(); has {
gl.Scissor(int32(clip.Min.X), int32(clip.Min.Y), int32(clip.W()), int32(clip.H()))
}
if tex == nil {
ct.vs.Begin()
ct.vs.Draw()
@ -327,9 +331,6 @@ func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) {
}
ct.vs.Begin()
if clip, has := ct.ClipRect(); has {
gl.Scissor(int32(clip.Min.X), int32(clip.Min.Y), int32(clip.W()), int32(clip.H()))
}
ct.vs.Draw()
ct.vs.End()