Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apv should remember offsetY #148

Open
GoogleCodeExporter opened this issue Dec 1, 2015 · 0 comments
Open

apv should remember offsetY #148

GoogleCodeExporter opened this issue Dec 1, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

i open a pdf file,and scroll to offsety(1000),offsetx(100).and exit apv.
when reopen the last pdf file, apv can't remember offsetY,it only scroll to 
current page top.

BookmarkEntry add offsety,and pageview restore offsetY to top.  it will improve 
ue.

    public int offsetY;

add constructor:
public BookmarkEntry(int numberOfPages, int page, float absoluteZoomLevel,
        int rotation, int offsetX, int offsetY) {
        this.comment = comment;
        this.numberOfPages = numberOfPages;
        this.page = page;
        this.absoluteZoomLevel = absoluteZoomLevel;
        this.rotation = rotation;
        this.offsetX = offsetX;
        this.offsetY=offsetY;
    }

public BookmarkEntry(String comment, String s) {
....
if (5 < data.length) {
            this.offsetY = Integer.parseInt(data[5]);
        }
        else {
            this.offsetY = 0;
        }


public String toString() {
        return ""+numberOfPages+" "+page+" "+absoluteZoomLevel+" "+rotation+" "+offsetX+" "+offsetY;
    }

public class PagesView:
public void goToBookmark() {
...
else {
            this.zoomLevel = (int)(this.bookmarkToRestore.absoluteZoomLevel / this.scaling0);
            this.rotation = this.bookmarkToRestore.rotation;
            //Point pos = getPagePositionInDocumentWithZoom(this.bookmarkToRestore.page);
            this.currentPage = this.bookmarkToRestore.page;
            this.top = /*pos.y + this.height / 2 + */this.bookmarkToRestore.offsetY;             //restore offsetY.
           this.left = this.getCurrentPageWidth(this.currentPage)/2 + marginX + this.bookmarkToRestore.offsetX;
            this.bookmarkToRestore = null;
        }


save offsety:
public BookmarkEntry toBookmarkEntry() {
        return new BookmarkEntry(this.pageSizes.length,
                this.currentPage, scaling0*zoomLevel, rotation, 
                this.left - this.getCurrentPageWidth(this.currentPage)/2 - marginX, this.top);
    }

Original issue reported on code.google.com by [email protected] on 12 Sep 2013 at 7:06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant