git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1234 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -7,11 +7,11 @@ namespace OpenRa.Game
|
||||
{
|
||||
class Region
|
||||
{
|
||||
PointF location;
|
||||
Point location;
|
||||
Size size;
|
||||
Renderable drawFunction;
|
||||
|
||||
public Region(PointF location, Size size, Renderable drawFunction)
|
||||
public Region(Point location, Size size, Renderable drawFunction)
|
||||
{
|
||||
this.location = location;
|
||||
this.size = size;
|
||||
@@ -20,7 +20,7 @@ namespace OpenRa.Game
|
||||
|
||||
public void Draw(Renderer renderer, Viewport viewport)
|
||||
{
|
||||
renderer.Device.EnableScissor((int)location.X, (int)location.Y, size.Width, size.Height);
|
||||
renderer.Device.EnableScissor(location.X, location.Y, size.Width, size.Height);
|
||||
drawFunction(renderer, viewport);
|
||||
renderer.Device.DisableScissor();
|
||||
}
|
||||
|
||||
@@ -36,16 +36,16 @@ namespace OpenRa.Game
|
||||
switch (anchor)
|
||||
{
|
||||
case AnchorStyles.Top:
|
||||
regions.Add(new Region(new PointF(0, 0), new Size(clientSize.Width, distanceFromAnchor), drawFunction));
|
||||
regions.Add(new Region(new Point(0, 0), new Size(clientSize.Width, distanceFromAnchor), drawFunction));
|
||||
break;
|
||||
case AnchorStyles.Bottom:
|
||||
regions.Add(new Region(new PointF(0, clientSize.Height - distanceFromAnchor), new Size(clientSize.Width, distanceFromAnchor), drawFunction));
|
||||
regions.Add(new Region(new Point(0, clientSize.Height - distanceFromAnchor), new Size(clientSize.Width, distanceFromAnchor), drawFunction));
|
||||
break;
|
||||
case AnchorStyles.Left:
|
||||
regions.Add(new Region(new PointF(0, 0), new Size(distanceFromAnchor, clientSize.Height), drawFunction));
|
||||
regions.Add(new Region(new Point(0, 0), new Size(distanceFromAnchor, clientSize.Height), drawFunction));
|
||||
break;
|
||||
case AnchorStyles.Right:
|
||||
regions.Add(new Region(new PointF(clientSize.Width - distanceFromAnchor, 0), new Size(distanceFromAnchor, clientSize.Height), drawFunction));
|
||||
regions.Add(new Region(new Point(clientSize.Width - distanceFromAnchor, 0), new Size(distanceFromAnchor, clientSize.Height), drawFunction));
|
||||
break;
|
||||
case AnchorStyles.None:
|
||||
throw new NotImplementedException();
|
||||
|
||||
Reference in New Issue
Block a user