Fix for total tabs

This commit is contained in:
raoulvdberge
2017-09-06 16:07:14 +02:00
parent f6786d7341
commit 015156dcd3
4 changed files with 4 additions and 4 deletions

View File

@@ -535,7 +535,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
@Override
public int getTotalTabPages() {
return (int) Math.floor((float) tabs.size() / (float) IGrid.TABS_PER_PAGE);
return (int) Math.floor((float) Math.max(0, tabs.size() - 1) / (float) IGrid.TABS_PER_PAGE);
}
@Override

View File

@@ -137,7 +137,7 @@ public class WirelessGrid implements IGrid {
@Override
public int getTotalTabPages() {
return (int) Math.floor((float) tabs.size() / (float) IGrid.TABS_PER_PAGE);
return (int) Math.floor((float) Math.max(0, tabs.size() - 1) / (float) IGrid.TABS_PER_PAGE);
}
@Override

View File

@@ -243,7 +243,7 @@ public class PortableGrid implements IGrid, IPortableGrid {
@Override
public int getTotalTabPages() {
return (int) Math.floor((float) tabs.size() / (float) IGrid.TABS_PER_PAGE);
return (int) Math.floor((float) Math.max(0, tabs.size() - 1) / (float) IGrid.TABS_PER_PAGE);
}
@Override

View File

@@ -314,7 +314,7 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
@Override
public int getTotalTabPages() {
return (int) Math.floor((float) tabs.size() / (float) IGrid.TABS_PER_PAGE);
return (int) Math.floor((float) Math.max(0, tabs.size() - 1) / (float) IGrid.TABS_PER_PAGE);
}
@Override