Exemplo n.º 1
0
    public static Rect ToUnityRect(uEmuera.Drawing.Rectangle rect, int width, int height)
    {
        var x = rect.X;
        var y = height - rect.Height - rect.Y;
        var w = rect.Width;

        if (x + w > width)
        {
            w = width - x;
        }
        var h = rect.Height;

        if (y + h > height)
        {
            h = height - y;
        }
        return(new Rect(x, y, w, h));
    }
Exemplo n.º 2
0
 public static Rect ToUnityRect(uEmuera.Drawing.Rectangle rect)
 {
     return(new Rect(rect.X, rect.Y, rect.Width, rect.Height));
 }