Commit 1fd28e04 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Set the clip width/height to the image size when initializing the proxy graphics.

parent 15349590
Pipeline #89679 passed with stages
in 1 minute and 43 seconds
......@@ -33,11 +33,11 @@ public final class DoubleBuffer
new SingleBuffer();
/** The last used width. */
private int _lastWidth =
private volatile int _lastWidth =
-1;
/** The last used height. */
private int _lastHeight =
private volatile int _lastHeight =
-1;
/**
......@@ -68,7 +68,7 @@ public final class DoubleBuffer
// We use the proxy regardless
ProxyGraphicsTarget proxy = this._offScreenProxy;
ProxyGraphics rv = new ProxyGraphics(proxy);
ProxyGraphics rv = new ProxyGraphics(proxy, __width, __height);
// If the surface area has not changed, then we can freely use the same
// graphics object, this will help reduce load on double-buffered
......
......@@ -62,16 +62,21 @@ public final class ProxyGraphics
* Initializes the proxy graphics with the given target.
*
* @param __target The target graphics proxy.
* @param __width The graphics width.
* @param __height The graphics height.
* @throws NullPointerException On null arguments.
* @since 2022/02/25
*/
public ProxyGraphics(ProxyGraphicsTarget __target)
public ProxyGraphics(ProxyGraphicsTarget __target, int __width,
int __height)
throws NullPointerException
{
if (__target == null)
throw new NullPointerException("NARG");
this.target = __target;
this._clipWidth = __width;
this._clipHeight = __height;
}
/**
......
......@@ -22,15 +22,15 @@ import javax.microedition.lcdui.Graphics;
public final class SingleBuffer
{
/** Available pixels. */
private int[] _pixels =
private volatile int[] _pixels =
new int[1];
/** The width of the buffer. */
private int _width =
private volatile int _width =
1;
/** The height of the buffer. */
private int _height =
private volatile int _height =
1;
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment