From 3ae612a84d3c4e2c7e1631482a0cd674417d3738 Mon Sep 17 00:00:00 2001 From: faiface Date: Sun, 21 May 2017 18:23:20 +0200 Subject: [PATCH] minor change --- sprite.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sprite.go b/sprite.go index 0c14bbf..ac12eac 100644 --- a/sprite.go +++ b/sprite.go @@ -61,7 +61,7 @@ func (s *Sprite) Draw(t Target, matrix Matrix) { s.DrawColorMask(t, matrix, nil) } -// DrawColorMask draw the Sprite onto the provided Target. The Sprite will be transformed by the +// DrawColorMask draws the Sprite onto the provided Target. The Sprite will be transformed by the // given Matrix and all of it's color will be multiplied by the given mask. // // If the mask is nil, a fully opaque white mask will be used, which causes no effect. @@ -74,8 +74,9 @@ func (s *Sprite) DrawColorMask(t Target, matrix Matrix, mask color.Color) { if mask == nil { mask = Alpha(1) } - if mask != s.mask { - s.mask = ToRGBA(mask) + rgba := ToRGBA(mask) + if rgba != s.mask { + s.mask = rgba dirty = true }