Merge pull request #3830 from deathbeam/center-stretched-fixed
Center stretched fixed mode horizontally
This commit is contained in:
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user