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:
@@ -331,6 +331,8 @@ public interface Client extends GameEngine
|
||||
|
||||
Dimension getStretchedDimensions();
|
||||
|
||||
Dimension getRealDimensions();
|
||||
|
||||
/**
|
||||
* Changes world. Works only on login screen
|
||||
* @param world world
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user