Re: Bug#245847: advi: page movement does not work
From: Philipp Weis <pweis@pweis.com>
Subject: Re: Bug#245847: advi: page movement does not work
Date: Fri, 30 Apr 2004 23:35:08 +0200
> On 26 Apr 2004, Yamagata Yoriyuki <yoriyuki@mbg.ocn.ne.jp> wrote:
> > From: Philipp Weis <pweis@pweis.com>
> > > horizontal page movement does not work at all ("page left" and "page
> > > right" should be available with h and l keys). With the j and k keys,
> > > the next or previous page is shown instead of the next or previous
> > > part of the current page.
> >
> > Do you change the scaling (by >, <) before h, l, j, k?
>
> I can not reproduce the problem without scaling. But this appears to
> be another problem with advi. If I resize the window to make it
> smaller, advi automatically adjusts the scaling value. This I way I am
> unable to see only part of page without manually resizing. There does
> not seem to be a "-noautoscale" command line option to prevent this
> behaviour.
>
> > I have a
> > similar problem, and I found that advi do not change st.dvi_hight and
> > st.dvi_width when the scaling is changed. This causes a problem. I
> > want to make a patch, but I do not have time (yet.)
>
> I'm looking forward to your patch.
Here is a quick fix. I think it fixes the autoscale problem, too.
*** advi-1.4.0/dviview.ml 2003-01-06 19:49:11.000000000 +0900
--- advi-1.4.0.new/dviview.ml 2004-05-15 02:34:19.000000000 +0900
***************
*** 322,328 ****
Grdev.set_bbox (Some (st.orig_x, st.orig_y, st.dvi_width, st.dvi_height));;
let update_dvi_size all ?dx ?dy st =
! init_geometry all st;
begin match dx with None -> () | Some z -> st.orig_x <- z end;
begin match dy with None -> () | Some z -> st.orig_y <- z end;
set_bbox st;;
--- 322,361 ----
Grdev.set_bbox (Some (st.orig_x, st.orig_y, st.dvi_width, st.dvi_height));;
let update_dvi_size all ?dx ?dy st =
! let dvi = st.dvi in
! let dvi_res = !dpi_resolution
! and mag = float dvi.Dvi.preamble.Dvi.pre_mag /. 1000.0 in
! let w_sp = dvi.Dvi.postamble.Dvi.post_width
! and h_sp = dvi.Dvi.postamble.Dvi.post_height in
! let w_in = mag *. ldexp (float w_sp /. dvi_res) (-16)
! and h_in = mag *. ldexp (float h_sp /. dvi_res) (-16) in
! let width = int_of_float (w_in *. st.base_dpi *. st.ratio)
! and height = int_of_float (h_in *. st.base_dpi *. st.ratio) in
! let (size_x, size_y) =
! if attr.crop then begin
! let sx = match attr.hmargin with
! | Px n -> width + 2 * n
! | In f -> width + int_of_float (st.base_dpi *. 2.0 *. f)
! | _ -> assert false
! and sy = match attr.vmargin with
! | Px n -> height + 2 * n
! | In f -> height + int_of_float (st.base_dpi *. 2.0 *. f)
! | _ -> assert false in
! (min attr.geom.Ageometry.width sx, min attr.geom.Ageometry.height sy)
! end else
! (attr.geom.Ageometry.width, attr.geom.Ageometry.height) in
! if all then
! begin
! let orig_x = (size_x - width) / 2
! and orig_y = (size_y - height) / 2 in
! st.size_x <- size_x;
! st.size_y <- size_y;
! st.orig_x <- orig_x;
! st.orig_y <- orig_y;
! end;
! st.dvi_width <- width;
! st.dvi_height <- height;
! st.toc <- None;
begin match dx with None -> () | Some z -> st.orig_x <- z end;
begin match dy with None -> () | Some z -> st.orig_y <- z end;
set_bbox st;;
--
Yamagata Yoriyuki
Reply to: