]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.gadgets.worlds: don't need world with-variable.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 19 Jan 2018 23:09:27 +0000 (15:09 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 19 Jan 2018 23:09:27 +0000 (15:09 -0800)
with-gl-context already does world set-global.

basis/ui/gadgets/worlds/worlds.factor

index c19231dc7b34d74635a0512d48a8c28cc3b89aed..1d9b8daf0e1a42ac347de2f55c4f4f99606c9473 100644 (file)
@@ -104,8 +104,7 @@ TUPLE: world-attributes
 ERROR: no-world-found ;
 
 : find-gl-context ( gadget -- )
-    find-world dup
-    [ set-gl-context ] [ no-world-found ] if ;
+    find-world [ set-gl-context ] [ no-world-found ] if* ;
 
 : (request-focus) ( child world ? -- )
     pick parent>> pick eq? [
@@ -216,14 +215,12 @@ ui-error-hook [ [ rethrow ] ] initialize
 
 : draw-world ( world -- )
     dup draw-world? [
-        dup world [
-            [
-                dup [ draw-world* ] with-gl-context
-                flush-layout-cache-hook get call( -- )
-            ] [
-                swap f >>active? <world-error> throw
-            ] recover
-        ] with-variable
+        [
+            dup [ draw-world* ] with-gl-context
+            flush-layout-cache-hook get call( -- )
+        ] [
+            swap f >>active? <world-error> throw
+        ] recover
     ] [ drop ] if ;
 
 world