Add support for getting real canvas dimensions

In stretched mode the canvas dimensions are the stretched dimensions, so
add method that will return normal game dimensions in case stretched
mode is enabled and we are not in resizeable mode.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-03-19 19:16:53 +01:00
committed by Adam
parent 0c5cde0894
commit 10629bfa4a
2 changed files with 14 additions and 0 deletions

View File

@@ -331,6 +331,8 @@ public interface Client extends GameEngine
Dimension getStretchedDimensions();
Dimension getRealDimensions();
/**
* Changes world. Works only on login screen
* @param world world

View File

@@ -85,6 +85,18 @@ public abstract class StretchedFixedModeMixin implements RSClient
cachedStretchedDimensions = null;
}
@Inject
@Override
public Dimension getRealDimensions()
{
if (isStretchedEnabled() && !isResized())
{
return Constants.GAME_FIXED_SIZE;
}
return getCanvas().getSize();
}
@Inject
@Override
public Dimension getStretchedDimensions()