Retina display fix
This commit is contained in:
@@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
version = '1.15.2-2.18'
|
||||
version = '1.15.2-2.20'
|
||||
group = 'nl.requios.effortlessbuilding' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'effortlessbuilding'
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class EffortlessBuilding
|
||||
{
|
||||
public static final String MODID = "effortlessbuilding";
|
||||
public static final String NAME = "Effortless Building";
|
||||
public static final String VERSION = "1.15.2-2.18";
|
||||
public static final String VERSION = "1.15.2-2.20";
|
||||
|
||||
public static EffortlessBuilding instance;
|
||||
|
||||
|
||||
@@ -140,8 +140,14 @@ public class RadialMenu extends Screen {
|
||||
final double middleX = width / 2.0;
|
||||
final double middleY = height / 2.0;
|
||||
|
||||
final double mouseXCenter = mouseX - middleX;
|
||||
final double mouseYCenter = -mouseY + middleY;
|
||||
//Fix for high def (retina) displays: use custom mouse coordinates
|
||||
//Borrowed from GameRenderer::updateCameraAndRender
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
int mouseXX = (int)(mc.mouseHelper.getMouseX() * (double)mc.getMainWindow().getScaledWidth() / (double)mc.getMainWindow().getWidth());
|
||||
int mouseYY = (int)(mc.mouseHelper.getMouseY() * (double)mc.getMainWindow().getScaledHeight() / (double)mc.getMainWindow().getHeight());
|
||||
|
||||
final double mouseXCenter = mouseXX - middleX;
|
||||
final double mouseYCenter = mouseYY - middleY;
|
||||
double mouseRadians = Math.atan2(mouseYCenter, mouseXCenter);
|
||||
|
||||
final double ringInnerEdge = 30;
|
||||
|
||||
Reference in New Issue
Block a user