Merge pull request #3830 from deathbeam/center-stretched-fixed

Center stretched fixed mode horizontally
This commit is contained in:
Tomas Slusny
2018-06-25 16:40:21 +02:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ public abstract class RSGameCanvasMixin extends Canvas implements RSGameCanvas
{ {
if (!client.isResized() && client.isStretchedEnabled()) if (!client.isResized() && client.isStretchedEnabled())
{ {
super.setSize(getParent().getWidth(), getParent().getHeight()); super.setSize(client.getStretchedDimensions().width, client.getStretchedDimensions().height);
} }
else else
{ {
@@ -83,7 +83,7 @@ public abstract class RSGameCanvasMixin extends Canvas implements RSGameCanvas
{ {
if (!client.isResized() && client.isStretchedEnabled()) if (!client.isResized() && client.isStretchedEnabled())
{ {
super.setLocation(0, 0); super.setLocation((getParent().getWidth() - client.getStretchedDimensions().width) / 2, 0);
} }
else else
{ {

View File

@@ -114,8 +114,8 @@ public abstract class StretchedFixedModeMixin implements RSClient
{ {
Canvas canvas = getCanvas(); Canvas canvas = getCanvas();
int width = canvas.getWidth(); int width = canvas.getParent().getWidth();
int height = canvas.getHeight(); int height = canvas.getParent().getHeight();
if (cachedStretchedDimensions == null || width != lastCanvasDimensions.width || height != lastCanvasDimensions.height) if (cachedStretchedDimensions == null || width != lastCanvasDimensions.width || height != lastCanvasDimensions.height)
{ {