From 499cf05c8cfc862164a20a69421521ab78c5cbe9 Mon Sep 17 00:00:00 2001 From: malc Date: Sat, 13 Aug 2011 12:08:05 +0400 Subject: [PATCH] The only robust way i can think of that will make persistent-location work --- main.ml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/main.ml b/main.ml index 2724ff1..adb5def 100644 --- a/main.ml +++ b/main.ml @@ -746,22 +746,24 @@ let winmatrix () = GlMat.scale3 (2.0 /. float conf.winw, 2.0 /. float conf.winh, 1.0); ;; -let reshape ~w ~h = - if state.invalidated = 0 - then state.anchor <- getanchor (); - - conf.winw <- w; - let w = truncate (float w *. conf.zoom) - state.scrollw in - let w = max w 2 in - state.w <- w; - conf.winh <- h; - GlMat.mode `modelview; - GlMat.load_identity (); - GlClear.color (scalecolor 1.0); - GlClear.clear [`color]; - - invalidate (); - wcmd "geometry" [`i w; `i h]; +let reshape = + let firsttime = ref true in + fun ~w ~h -> + if state.invalidated = 0 && not !firsttime + then (state.anchor <- getanchor (); firsttime := false); + + conf.winw <- w; + let w = truncate (float w *. conf.zoom) - state.scrollw in + let w = max w 2 in + state.w <- w; + conf.winh <- h; + GlMat.mode `modelview; + GlMat.load_identity (); + GlClear.color (scalecolor 1.0); + GlClear.clear [`color]; + + invalidate (); + wcmd "geometry" [`i w; `i h]; ;; let drawstring size x y s = -- 2.11.4.GIT