本文整理汇总了C#中Gdk.Rectangle.IntersectsWith方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.Rectangle.IntersectsWith方法的具体用法?C# Gdk.Rectangle.IntersectsWith怎么用?C# Gdk.Rectangle.IntersectsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.Rectangle
的用法示例。
在下文中一共展示了Gdk.Rectangle.IntersectsWith方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WindowsShareViewport
static bool WindowsShareViewport (Wnck.Window first, Wnck.Window second)
{
if (first == null || second == null) return false;
Wnck.Workspace wksp = first.Workspace ?? second.Workspace;
if (wksp == null) return false;
Gdk.Rectangle firstGeo, secondGeo;
first.GetGeometry (out firstGeo.X, out firstGeo.Y, out firstGeo.Width, out firstGeo.Height);
second.GetGeometry (out secondGeo.X, out secondGeo.Y, out secondGeo.Width, out secondGeo.Height);
firstGeo.X += wksp.ViewportX;
firstGeo.Y += wksp.ViewportY;
secondGeo.X += wksp.ViewportX;
secondGeo.Y += wksp.ViewportY;
int viewportWidth, viewportHeight;
viewportWidth = first.Screen.Width;
viewportHeight = first.Screen.Height;
int firstViewportX = ((firstGeo.X + firstGeo.Width / 2) / viewportWidth) * viewportWidth;
int firstViewportY = ((firstGeo.Y + firstGeo.Height / 2) / viewportHeight) * viewportHeight;
Gdk.Rectangle viewpRect = new Gdk.Rectangle (firstViewportX, firstViewportY,
viewportWidth, viewportHeight);
return viewpRect.IntersectsWith (secondGeo);
}
示例2: OnPaint
protected override void OnPaint(Gdk.Drawable win, Gdk.Point offset, Gdk.Rectangle clip)
{
Gdk.Rectangle r = new Gdk.Rectangle (offset.X + Location.X, offset.Y + Location.Y, cap_width, sz.Height);
if (r.IntersectsWith (clip)) {
win.DrawRectangle (view.Style.MidGC (0), false, r);
caption.Paint (win, Globalize (offset), clip);
}
r.X += cap_width;
r.Width = sz.Width - cap_width - 1;
if (r.IntersectsWith (clip)) {
win.DrawRectangle (view.Style.MidGC (0), false, r);
summ.Paint (win, Globalize (offset), clip);
}
}