mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 00:20:51 +00:00
- fixed F2DDrawer::SetClipRect.
This commit is contained in:
parent
54e0201204
commit
936e89e3d4
1 changed files with 8 additions and 4 deletions
|
@ -393,10 +393,14 @@ DEFINE_ACTION_FUNCTION(FCanvas, DrawShapeFill)
|
||||||
|
|
||||||
void F2DDrawer::SetClipRect(int x, int y, int w, int h)
|
void F2DDrawer::SetClipRect(int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
clipleft = clamp(x, 0, GetWidth());
|
if (x < 0) { w += x; x = 0; }
|
||||||
clipwidth = clamp(w, -1, GetWidth() - x);
|
if (y < 0) { h += y; y = 0; }
|
||||||
cliptop = clamp(y, 0, GetHeight());
|
if (x >= GetWidth()) { x = GetWidth(); w = 0; }
|
||||||
clipheight = clamp(h, -1, GetHeight() - y);
|
if (y >= GetHeight()) { x = GetHeight(); h = 0; }
|
||||||
|
clipleft = x;
|
||||||
|
clipwidth = w;
|
||||||
|
cliptop = y;
|
||||||
|
clipheight = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(_Screen, SetClipRect)
|
DEFINE_ACTION_FUNCTION(_Screen, SetClipRect)
|
||||||
|
|
Loading…
Reference in a new issue