]> gitweb.factorcode.org Git - factor.git/commitdiff
fixed a color issue in texture rendering
authorMatthew Willis <matthew.willis@mac.com>
Sun, 25 May 2008 18:59:41 +0000 (11:59 -0700)
committerMatthew Willis <matthew.willis@mac.com>
Sun, 25 May 2008 18:59:41 +0000 (11:59 -0700)
extra/cairo/gadgets/gadgets.factor

index fa5364557e6faa60150ac3d5e1b0411e20226d2f..bda18d04b4ddeb0e798bc06d32faf821cd58c488 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: cairo cairo.ffi ui.render kernel opengl.gl opengl
 math byte-arrays ui.gadgets accessors arrays 
-namespaces io.backend memoize ;
+namespaces io.backend memoize colors ;
 
 IN: cairo.gadgets
 
@@ -64,6 +64,7 @@ M: cached-cairo draw-gadget* ( gadget -- )
     GL_TEXTURE_2D [
         [
             dup render-to-texture
+            white gl-color
             GL_TEXTURE_2D over texture>> glBindTexture
             GL_QUADS [
                 [ width>> ] [ height>> ] bi 2array four-sides
@@ -76,7 +77,8 @@ M: cached-cairo graft* ( gadget -- )
     gen-texture >>texture drop ;
 
 M: cached-cairo ungraft* ( gadget -- )
-    texture>> delete-texture ;
+    [ texture>> delete-texture ]
+    [ \ render-to-texture invalidate-memoized ] bi ;
     
 M: cairo-gadget pref-dim* ( gadget -- rect )
     [ width>> ] [ height>> ] bi 2array ;