public void ClipRect(int x, int y, int width, int height) { if (isClose) { return; } if (!isClipRect) { device.RasterizerState = clipRasterizerState; isClipRect = true; } try { xnaClip = xnaClip.GetIntersection(new RectBox((x + GetTranslateX()) * LSystem.scaleWidth, (y + GetTranslateY()) * LSystem.scaleHeight, width * LSystem.scaleWidth, height * LSystem.scaleHeight)); device.ScissorRectangle = xnaClip.GetRectangle2D(); } catch (System.Exception) { } }