From 073333f245e2a5026ec97fdcb43eadab3f2717d0 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 9 Mar 2009 20:23:34 -0500 Subject: [PATCH] Re-implement since joystick-demo still uses it --- basis/ui/pens/polygon/polygon.factor | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/basis/ui/pens/polygon/polygon.factor b/basis/ui/pens/polygon/polygon.factor index 4d7793dd65..d244cc71d2 100644 --- a/basis/ui/pens/polygon/polygon.factor +++ b/basis/ui/pens/polygon/polygon.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors colors help.markup help.syntax kernel opengl -opengl.gl sequences specialized-arrays.float ui.pens ; +opengl.gl sequences specialized-arrays.float math.vectors +ui.gadgets ui.pens ; IN: ui.pens.polygon ! Polygon pen @@ -30,4 +31,8 @@ M: polygon draw-interior [ color>> gl-color ] [ interior-vertices>> gl-vertex-pointer ] [ [ GL_POLYGON 0 ] dip interior-count>> glDrawArrays ] - tri ; \ No newline at end of file + tri ; + +: ( color points -- gadget ) + [ ] [ { 0 0 } [ vmax ] reduce ] bi + [ ] 2dip [ >>interior ] [ >>dim ] bi* ; \ No newline at end of file