From 5184b220abd28f4d7c1b2f5938e37bfaae0c7c49 Mon Sep 17 00:00:00 2001 From: malc Date: Fri, 29 Jul 2011 06:06:30 +0400 Subject: [PATCH] Simplify text area rect code --- main.ml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/main.ml b/main.ml index d29f11d..7302bbb 100644 --- a/main.ml +++ b/main.ml @@ -595,16 +595,11 @@ let reshape ~w ~h = let showtext c s = GlDraw.viewport 0 0 state.winw state.h; GlDraw.color (0.0, 0.0, 0.0); - GlMat.push (); - GlMat.load_identity (); - GlMat.rotate ~x:1.0 ~angle:180.0 (); - GlMat.translate ~x:~-.1.0 ~y:~-.1.0 (); - GlMat.scale3 (2.0 /. float state.winw, 2.0 /. float state.h, 1.0); + let sw = float (conf.scrollw - 1) *. float state.w /. float state.winw in GlDraw.rect (0.0, float (state.h - 18)) - (float (state.winw - conf.scrollw), float state.h) + (float state.w -. sw, float state.h) ; - GlMat.pop (); let font = Glut.BITMAP_8_BY_13 in GlDraw.color (1.0, 1.0, 1.0); GlPix.raster_pos ~x:0.0 ~y:(float (state.h - 5)) (); -- 2.11.4.GIT