From 7aeae444a9fac9a9ab082a082d8201a09a03b287 Mon Sep 17 00:00:00 2001 From: Thomas Friedel Date: Sat, 26 Jan 2019 23:02:02 +0100 Subject: [PATCH] fixed a rect clipping bug --- paths.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paths.go b/paths.go index f47ca62..bf5c75c 100644 --- a/paths.go +++ b/paths.go @@ -568,6 +568,10 @@ func (cv *Canvas) scissor(path []pathPoint) { br[1] = math.Min(br[1], cv.state.scissor.br[1]) } + if tl[0] >= br[0] || tl[1] >= br[1] { + tl, br = vec{}, vec{} + } + cv.state.scissor = scissor{tl: tl, br: br, on: true} cv.applyScissor() }