mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Prevent card art flickering in list
This commit is contained in:
@@ -158,7 +158,7 @@ public class CardRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static float getCardListItemHeight() {
|
public static float getCardListItemHeight() {
|
||||||
return MANA_SYMBOL_SIZE + FSkinFont.get(12).getFont().getLineHeight() + 3 * FList.PADDING + 1;
|
return Math.round(MANA_SYMBOL_SIZE + FSkinFont.get(12).getFont().getLineHeight() + 3 * FList.PADDING + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Map<PaperCard, TextureRegion> cardArtCache = new HashMap<PaperCard, TextureRegion>();
|
private static Map<PaperCard, TextureRegion> cardArtCache = new HashMap<PaperCard, TextureRegion>();
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class FList<E> extends FScrollPane implements Iterable<E> {
|
|||||||
float itemHeight = renderer.getItemHeight();
|
float itemHeight = renderer.getItemHeight();
|
||||||
boolean drawSeparators = drawLineSeparators();
|
boolean drawSeparators = drawLineSeparators();
|
||||||
|
|
||||||
float y = getItemTop(startIndex);
|
float y = Math.round(getItemTop(startIndex)); //round y so items don't flicker from rounding error
|
||||||
float valueWidth = w - 2 * PADDING;
|
float valueWidth = w - 2 * PADDING;
|
||||||
float valueHeight = itemHeight - 2 * PADDING;
|
float valueHeight = itemHeight - 2 * PADDING;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user