Example #1
0
func (self Rectangle) Union(r2 Rectangle) Rectangle {
	var cr3 C.GdkRectangle
	cr1 := nativeFromRectangle(self)
	defer cr1.Free()
	cr2 := nativeFromRectangle(r2)
	defer cr2.Free()
	C.gdk_rectangle_union((*C.GdkRectangle)(cr1.GetPtr()), (*C.GdkRectangle)(cr2.GetPtr()), &cr3)
	rec := newRectangleFromNative(unsafe.Pointer(&cr3)).(Rectangle)

	return rec
}
Example #2
0
/*
Calculates the union of two rectangles.
The union of rectangles @src1 and @src2 is the smallest rectangle which
includes both @src1 and @src2 within it.
It is allowed for @dest to be the same as either @src1 or @src2.
*/
func RectangleUnion(src1 *C.GdkRectangle, src2 *C.GdkRectangle) (dest C.GdkRectangle) {
	C.gdk_rectangle_union(src1, src2, &dest)
	return
}