Added some helper methods
This commit is contained in:
Родитель
14de1a816e
Коммит
2035f1098e
|
@ -232,6 +232,11 @@ namespace Xwt.Drawing
|
|||
handler.Translate (Backend, tx, ty);
|
||||
}
|
||||
|
||||
public void Translate (Point p)
|
||||
{
|
||||
handler.Translate (Backend, p.X, p.Y);
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
handler.Dispose (Backend);
|
||||
|
|
|
@ -67,10 +67,12 @@ namespace Xwt {
|
|||
return X.GetHashCode () ^ Y.GetHashCode ();
|
||||
}
|
||||
|
||||
public void Offset (double dx, double dy)
|
||||
public Point Offset (double dx, double dy)
|
||||
{
|
||||
X += dx;
|
||||
Y += dy;
|
||||
Point p = this;
|
||||
p.X += dx;
|
||||
p.Y += dy;
|
||||
return p;
|
||||
}
|
||||
|
||||
public bool IsEmpty {
|
||||
|
|
|
@ -177,6 +177,12 @@ namespace Xwt
|
|||
}
|
||||
}
|
||||
|
||||
public Point Center {
|
||||
get {
|
||||
return new Point (X + Width / 2, Y + Height / 2);
|
||||
}
|
||||
}
|
||||
|
||||
// Inflate and Offset
|
||||
public Rectangle Inflate (Size sz)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче