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:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user