efl.evas.Rect
Class¶efl.evas.
Rect
(*args, **kargs)¶Bases: object
This class provides the description of a rectangle and means to access and modify its properties in an easy way.
Usage example:
>>> r1 = Rect(10, 20, 30, 40)
>>> r2 = Rect((0, 0), (100, 100))
>>> r1
Rect(x=10, y=20, w=30, h=40)
>>> r2
Rect(x=0, y=0, w=100, h=100)
>>> r1.contains(r2)
False
>>> r2.contains(r1)
True
>>> r1 in r2 # same as r2.contains(r1)
True
>>> r1.intercepts(r2)
True
Attention
This is not a graphical object! Do not confuse with
efl.evas.Rectangle
.
area
¶(int w, int h)
bottom
¶int
bottom_left
¶(int x, int y)
bottom_right
¶(int x, int y)
center
¶(int x, int y)
center_x
¶int
center_y
¶int
clamp
¶Returns a new Rect that represents current moved inside given parameter.
If given rectangle is smaller, it’ll be centered.
obj –
clip
¶Returns a new Rect that represents current cropped inside parameter.
obj –
contains
¶Checks if this rectangle contains given rectangle.
obj –
bool
contains_point
¶Checks if this rectangle contains the given point.
x (int) –
y (int) –
bool
cx
¶cx: ‘int’
cy
¶cy: ‘int’
h
¶int
height
¶int
inflate
¶Returns a new Rect that represents current inflated by given amount.
amount_x (int) –
amount_y (int) –
intercepts
¶Deprecated since version 1.14: Use intersects() instead
intersects
¶Checks if this rectangle and the given rectangle intersect.
obj –
bool
left
¶int
move_by
¶Returns a new Rect that represents current moved by given offsets.
offset_x (int) –
offset_y (int) –
normalize
¶Normalize coordinates so both width and height are positive.
pos
¶(int x, int y)
right
¶int
size
¶(int w, int h)
top
¶int
top_left
¶(int x, int y)
top_right
¶(int x, int y)
w
¶int
width
¶int
x
¶int
x0
¶x0: ‘int’
x1
¶x1: ‘int’
y
¶int
y0
¶y0: ‘int’
y1
¶y1: ‘int’