From bb44effcb31e170617b49396932a9f516ec1fd2e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 11 Nov 2008 02:35:27 -0600 Subject: [PATCH] Forgot to include this in the last patch --- basis/ui/render/render.factor | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/basis/ui/render/render.factor b/basis/ui/render/render.factor index b786a5e1fe..71304aca0b 100644 --- a/basis/ui/render/render.factor +++ b/basis/ui/render/render.factor @@ -23,7 +23,7 @@ SYMBOL: viewport-translation [ rect-intersect ] keep dim>> dup { 0 1 } v* viewport-translation set { 0 0 } over gl-viewport - 0 swap first2 0 gluOrtho2D + -0.5 swap first2 [ 0.5 - ] [ 0.5 + ] bi* 0.5 gluOrtho2D clip set do-clip ; @@ -103,26 +103,31 @@ GENERIC: recompute-pen ( gadget pen -- ) ] if ; ! Solid fill/border -TUPLE: solid < caching-pen color last-vertices ; +TUPLE: solid < caching-pen color interior-vertices boundary-vertices ; : ( color -- solid ) solid new swap >>color ; M: solid recompute-pen - swap dim>> (rectangle-vertices) >>last-vertices drop ; + swap dim>> + [ (fill-rect-vertices) >>interior-vertices ] + [ (rect-vertices) >>boundary-vertices ] + bi drop ; > gl-color ] - [ last-vertices>> gl-vertex-pointer ] tri ; + [ compute-pen ] [ color>> gl-color ] bi ; PRIVATE> -M: solid draw-interior (solid) (gl-fill-rect) ; +M: solid draw-interior + [ (solid) ] [ interior-vertices>> gl-vertex-pointer ] bi + (gl-fill-rect) ; -M: solid draw-boundary (solid) (gl-rect) ; +M: solid draw-boundary + [ (solid) ] [ boundary-vertices>> gl-vertex-pointer ] bi + (gl-rect) ; ! Gradient pen TUPLE: gradient < caching-pen colors last-vertices last-colors ;