Skip to content

getVisibleRange function return incorrect value after scrollTo(index) if set Zoom In/Out #236

Description

@LiuChang56

I met a problem that in my code, we have a function like that:

image
As excepted, if firstIdx = 1200, after scrollTo(firstIdx + 1) called, firstIdx2 should be 1201, but now it is still 1200.
It worked well if we set Zoom as 100% but failed if Zoom is 110% or other zoom value.
The reason could be that:
In function getVisibleRange(), we will use this.getStartAndEnd(0) to get the start and end value. But if we zoom to browser, this value could be a decimal(come from getScroll()), so in the loop code part, we could not get the correct value of 'first':
image

So, could you please help check the behavior and enhance the logic in zoom case? Thanks a lot

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions