本文整理汇总了C#中Gdk.Rectangle.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.Rectangle.Contains方法的具体用法?C# Gdk.Rectangle.Contains怎么用?C# Gdk.Rectangle.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.Rectangle
的用法示例。
在下文中一共展示了Gdk.Rectangle.Contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTileSizeAllocated
private void OnTileSizeAllocated (object o, SizeAllocatedArgs args)
{
ScrolledWindow scroll;
if (Parent == null || (scroll = Parent.Parent as ScrolledWindow) == null) {
return;
}
Tile tile = (Tile)o;
if (tiles.IndexOf (tile) != selected_index) {
return;
}
Gdk.Rectangle ta = ((Tile)o).Allocation;
Gdk.Rectangle va = new Gdk.Rectangle (0, (int)scroll.Vadjustment.Value,
Allocation.Width, Parent.Allocation.Height);
if (!va.Contains (ta)) {
double delta = 0.0;
if (ta.Bottom > va.Bottom) {
delta = ta.Bottom - va.Bottom;
} else if (ta.Top < va.Top) {
delta = ta.Top - va.Top;
}
scroll.Vadjustment.Value += delta;
QueueDraw();
}
}
示例2: Contains
public bool Contains (int x, int y, Atk.CoordType coordType)
{
int x_extents, y_extents, w, h;
GetExtents (out x_extents, out y_extents, out w, out h, coordType);
Gdk.Rectangle extents = new Gdk.Rectangle (x_extents, y_extents, w, h);
return extents.Contains (x, y);
}
示例3: HitGripper
int HitGripper(int x)
{
var gripper = GripperPositions();
foreach (var g in gripper)
{
int xv = g.Value;
Gdk.Rectangle rect = new Gdk.Rectangle(xv - GripperWidth, 0, GripperWidth, TotalHeight);
if (rect.Contains(x, 0))
return g.Key;
}
return -1;
}