Center stretched fixed mode horizontally

To fit with fixed mode with stretched fixed disabled, center stretched
fixed mode horizontally.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-06-16 00:56:32 +02:00
parent e83d09124a
commit b0127283d1
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())
{
super.setSize(getParent().getWidth(), getParent().getHeight());
super.setSize(client.getStretchedDimensions().width, client.getStretchedDimensions().height);
}
else
{
@@ -83,7 +83,7 @@ public abstract class RSGameCanvasMixin extends Canvas implements RSGameCanvas
{
if (!client.isResized() && client.isStretchedEnabled())
{
super.setLocation(0, 0);
super.setLocation((getParent().getWidth() - client.getStretchedDimensions().width) / 2, 0);
}
else
{

View File

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