ICEpdf
  1. ICEpdf
  2. PDF-62

Scroll page to top when setting Fit to Width

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 4.0 - Beta, 4.0
    • Component/s: Viewer RI
    • Labels:
      None
    • Environment:
      -

      Description

      When setting fit to width, the page zooms towards the center rather than
      positioning itself at the top. The customer would like us to consider this fix
      for our next release. Here is what he has done:

      I got this working by modifying the setFitMode(int) method as follows:

       At the bottom of the method I replaced the call to setZoom(newZoom, null, true)
      with the following logic:

       // set appropriate zoom level
       // If we're scrolled all the way to the top, center to top of document when zoom.
       if (getVerticalScrollBar().getValue() == 0)
       {
         setZoom(newZoom, new Point(0, 0), true);
       }
       else
        {
         setZoom(newZoom, null, true);
       }

        Activity

        Hide
        Ken Walker added a comment -

        Just to clarify the issue, I don't necessarily want it to scroll to the top whenever you set fit to width...only if you're already scrolled to the top.

        Show
        Ken Walker added a comment - Just to clarify the issue, I don't necessarily want it to scroll to the top whenever you set fit to width...only if you're already scrolled to the top.
        Hide
        Ken Walker added a comment -

        I have attached the patch file which I've submitted as a contribution to be considered for a future release.

        Show
        Ken Walker added a comment - I have attached the patch file which I've submitted as a contribution to be considered for a future release.
        Hide
        Patrick Corless added a comment -

        Thanks Ken, I'll make sure it gets added to the next release.

        Show
        Patrick Corless added a comment - Thanks Ken, I'll make sure it gets added to the next release.
        Hide
        Carlo Guglielmin added a comment -

        I tested and applied this patch in revision 19892. Thanks Ken Walker!

        Show
        Carlo Guglielmin added a comment - I tested and applied this patch in revision 19892. Thanks Ken Walker!

          People

          • Assignee:
            Carlo Guglielmin
            Reporter:
            Tyler Johnson
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: