mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Improve card zoom rendering size
This commit is contained in:
@@ -13,9 +13,15 @@ import forge.properties.ForgePreferences.FPref;
|
||||
import forge.util.Base64Coder;
|
||||
|
||||
public class ImageUtil {
|
||||
public static float getNearestHQSize(float baseSize, float actualSize) {
|
||||
//get nearest power of actualSize to baseSize so that the image renders good
|
||||
return (float)Math.round(actualSize) * (float)Math.pow(2, (double)Math.round(Math.log((double)(baseSize / actualSize)) / Math.log(2)));
|
||||
}
|
||||
|
||||
public static PaperCard getPaperCardFromImageKey(String key) {
|
||||
if( key == null )
|
||||
if ( key == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PaperCard cp = StaticData.instance().getCommonCards().getCard(key);
|
||||
if ( cp == null )
|
||||
|
||||
Reference in New Issue
Block a user