Skip to content

Commit

Permalink
Fix corner issue when zoom out on page change and RTL reading are bot…
Browse files Browse the repository at this point in the history
…h enabled
  • Loading branch information
maforget committed Aug 27, 2024
1 parent 1df10a0 commit 4e07393
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions ComicRack.Engine/Display/ComicDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,19 +1641,14 @@ private void display_PageChanged(object sender, BookPageEventArgs e)
{
if (zoomInOutOnPageChange && oldZoom != 0f)
{
bool flag = e.OldPage < e.Page;
if (RightToLeftReading && RightToLeftReadingMode == RightToLeftReadingMode.FlipParts)
{
flag = !flag;
}
if (flag)
{
ZoomTo(new Point(-500000, -500000), oldZoom);
}
bool goingForward = e.OldPage < e.Page;
bool RTL = RightToLeftReading && RightToLeftReadingMode == RightToLeftReadingMode.FlipParts;
int corner = RTL ? -1 : 1;

if (goingForward)
ZoomTo(new Point(corner * -500000, -500000), oldZoom); //Next page: Arrive on Upper Left Corner, Upper Right with RTL
else
{
ZoomTo(new Point(500000, 500000), oldZoom);
}
ZoomTo(new Point(corner * 500000, 500000), oldZoom); //Previous Page: Arrive on Bottom Right Corner, Bottom Left with RTL
}
oldZoom = 0f;
}
Expand Down

0 comments on commit 4e07393

Please sign in to comment.