From a74fb36053fc585cf81a39778c89d59f62fc69c5 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 27 Sep 2019 22:32:44 +0400 Subject: [PATCH] * UI: fixed error in card viewer while viewing pages with tokens; --- .../mage/client/deckeditor/collection/viewer/MageBook.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java index ae4d2db50c..7ef72f3440 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java @@ -695,13 +695,13 @@ public class MageBook extends JComponent { int totalTokensEmblems = totalTokens + getTotalNumEmblems(set); int start = 0; if (!(page * conf.CARDS_PER_PAGE <= totalTokensEmblems && (page + 1) * conf.CARDS_PER_PAGE >= totalTokensEmblems)) { - start = page * conf.CARDS_PER_PAGE - totalTokensEmblems; + start = Math.max(0, page * conf.CARDS_PER_PAGE - totalTokensEmblems); pageRight.setVisible(true); } int end = planes.size(); if ((page + 1) * conf.CARDS_PER_PAGE < totalTokensEmblems + planes.size()) { - end = (page + 1) * conf.CARDS_PER_PAGE - totalTokensEmblems; + end = Math.max(0, (page + 1) * conf.CARDS_PER_PAGE - totalTokensEmblems); pageRight.setVisible(true); } else { pageRight.setVisible(false);