当前位置: 首页>>代码示例>>C#>>正文


C# Gdk.Rectangle.IntersectsWith方法代码示例

本文整理汇总了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);
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:30,代码来源:WindowControl.cs

示例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);
     }
 }
开发者ID:mono,项目名称:monodoc-widgets,代码行数:14,代码来源:SummaryTableItem.cs


注:本文中的Gdk.Rectangle.IntersectsWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。