@@ -197,4 +197,177 @@ class Rect(Collection[int]):
197197 self , rect_dict : Dict [_K , "Rect" ], values : bool
198198 ) -> List [Tuple [_K , "Rect" ]]: ...
199199
200+ class FRect (Collection [float ]):
201+ x : float
202+ y : float
203+ top : float
204+ left : float
205+ bottom : float
206+ right : float
207+ topleft : Tuple [float , float ]
208+ bottomleft : Tuple [float , float ]
209+ topright : Tuple [float , float ]
210+ bottomright : Tuple [float , float ]
211+ midtop : Tuple [float , float ]
212+ midleft : Tuple [float , float ]
213+ midbottom : Tuple [float , float ]
214+ midright : Tuple [float , float ]
215+ center : Tuple [float , float ]
216+ centerx : float
217+ centery : float
218+ size : Tuple [float , float ]
219+ width : float
220+ height : float
221+ w : float
222+ h : float
223+ __hash__ : None # type: ignore
224+ __safe_for_unpickling__ : Literal [True ]
225+ @overload
226+ def __init__ (
227+ self , left : float , top : float , width : float , height : float
228+ ) -> None : ...
229+ @overload
230+ def __init__ (self , left_top : Coordinate , width_height : Coordinate ) -> None : ...
231+ @overload
232+ def __init__ (self , single_arg : RectValue ) -> None : ...
233+ def __len__ (self ) -> Literal [4 ]: ...
234+ def __iter__ (self ) -> Iterator [float ]: ...
235+ @overload
236+ def __getitem__ (self , i : int ) -> float : ...
237+ @overload
238+ def __getitem__ (self , s : slice ) -> List [float ]: ...
239+ @overload
240+ def __setitem__ (self , key : int , value : float ) -> None : ...
241+ @overload
242+ def __setitem__ (self , key : slice , value : Union [float , FRect ]) -> None : ...
243+ def __copy__ (self ) -> FRect : ...
244+ copy = __copy__
245+ @overload
246+ def move (self , x : float , y : float ) -> FRect : ...
247+ @overload
248+ def move (self , move_by : Coordinate ) -> FRect : ...
249+ @overload
250+ def move_ip (self , x : float , y : float ) -> None : ...
251+ @overload
252+ def move_ip (self , move_by : Coordinate ) -> None : ...
253+ @overload
254+ def inflate (self , x : float , y : float ) -> FRect : ...
255+ @overload
256+ def inflate (self , inflate_by : Coordinate ) -> FRect : ...
257+ @overload
258+ def inflate_ip (self , x : float , y : float ) -> None : ...
259+ @overload
260+ def inflate_ip (self , inflate_by : Coordinate ) -> None : ...
261+ @overload
262+ def update (self , left : float , top : float , width : float , height : float ) -> None : ...
263+ @overload
264+ def update (self , left_top : Coordinate , width_height : Coordinate ) -> None : ...
265+ @overload
266+ def update (self , single_arg : RectValue ) -> None : ...
267+ @overload
268+ def clamp (self , rect : RectValue ) -> FRect : ...
269+ @overload
270+ def clamp (self , left_top : Coordinate , width_height : Coordinate ) -> FRect : ...
271+ @overload
272+ def clamp (self , left : float , top : float , width : float , height : float ) -> FRect : ...
273+ @overload
274+ def clamp_ip (self , rect : RectValue ) -> None : ...
275+ @overload
276+ def clamp_ip (self , left_top : Coordinate , width_height : Coordinate ) -> None : ...
277+ @overload
278+ def clamp_ip (
279+ self , left : float , top : float , width : float , height : float
280+ ) -> None : ...
281+ @overload
282+ def clip (self , rect : RectValue ) -> FRect : ...
283+ @overload
284+ def clip (self , left_top : Coordinate , width_height : Coordinate ) -> FRect : ...
285+ @overload
286+ def clip (self , left : float , top : float , width : float , height : float ) -> FRect : ...
287+ @overload
288+ def clipline (
289+ self , x1 : float , x2 : float , x3 : float , x4 : float
290+ ) -> Union [Tuple [Tuple [float , float ], Tuple [float , float ]], Tuple [()]]: ...
291+ @overload
292+ def clipline (
293+ self , first_coordinate : Coordinate , second_coordinate : Coordinate
294+ ) -> Union [Tuple [Tuple [float , float ], Tuple [float , float ]], Tuple [()]]: ...
295+ @overload
296+ def clipline (
297+ self , rect_arg : RectValue
298+ ) -> Union [Tuple [Tuple [float , float ], Tuple [float , float ]], Tuple [()]]: ...
299+ @overload
300+ def union (self , rect : RectValue ) -> FRect : ...
301+ @overload
302+ def union (self , left_top : Coordinate , width_height : Coordinate ) -> FRect : ...
303+ @overload
304+ def union (self , left : float , top : float , width : float , height : float ) -> FRect : ...
305+ @overload
306+ def union_ip (self , rect : RectValue ) -> None : ...
307+ @overload
308+ def union_ip (self , left_top : Coordinate , width_height : Coordinate ) -> None : ...
309+ @overload
310+ def union_ip (
311+ self , left : float , top : float , width : float , height : float
312+ ) -> None : ...
313+ def unionall (self , rect : Sequence [RectValue ]) -> FRect : ...
314+ def unionall_ip (self , rect_sequence : Sequence [RectValue ]) -> None : ...
315+ @overload
316+ def fit (self , rect : RectValue ) -> FRect : ...
317+ @overload
318+ def fit (self , left_top : Coordinate , width_height : Coordinate ) -> FRect : ...
319+ @overload
320+ def fit (self , left : float , top : float , width : float , height : float ) -> FRect : ...
321+ def normalize (self ) -> None : ...
322+ def __contains__ (self , rect : Union [RectValue , float ]) -> bool : ... # type: ignore[override]
323+ @overload
324+ def contains (self , rect : RectValue ) -> bool : ...
325+ @overload
326+ def contains (self , left_top : Coordinate , width_height : Coordinate ) -> bool : ...
327+ @overload
328+ def contains (
329+ self , left : float , top : float , width : float , height : float
330+ ) -> bool : ...
331+ @overload
332+ def collidepoint (self , x : float , y : float ) -> bool : ...
333+ @overload
334+ def collidepoint (self , x_y : Coordinate ) -> bool : ...
335+ @overload
336+ def colliderect (self , rect : RectValue ) -> bool : ...
337+ @overload
338+ def colliderect (self , left_top : Coordinate , width_height : Coordinate ) -> bool : ...
339+ @overload
340+ def colliderect (
341+ self , left : float , top : float , width : float , height : float
342+ ) -> bool : ...
343+ def collidelist (self , rect_list : Sequence [RectValue ]) -> float : ...
344+ def collidelistall (self , rect_list : Sequence [RectValue ]) -> List [float ]: ...
345+ def collideobjectsall (
346+ self , objects : Sequence [_T ], key : Optional [Callable [[_T ], RectValue ]] = None
347+ ) -> List [_T ]: ...
348+ def collideobjects (
349+ self , objects : Sequence [_T ], key : Optional [Callable [[_T ], RectValue ]] = None
350+ ) -> Optional [_T ]: ...
351+ # Also undocumented: the dict collision methods take a 'values' argument
352+ # that defaults to False. If it is False, the keys in rect_dict must be
353+ # Rect-like; otherwise, the values must be Rects.
354+ @overload
355+ def collidedict (
356+ self , rect_dict : Dict [RectValue , _V ], values : bool = ...
357+ ) -> Tuple [RectValue , _V ]: ...
358+ @overload
359+ def collidedict (
360+ self , rect_dict : Dict [_K , "FRect" ], values : bool
361+ ) -> Tuple [_K , "FRect" ]: ...
362+ @overload
363+ def collidedictall (
364+ self , rect_dict : Dict [RectValue , _V ], values : bool = ...
365+ ) -> List [Tuple [RectValue , _V ]]: ...
366+ @overload
367+ def collidedictall (
368+ self , rect_dict : Dict [_K , "FRect" ], values : bool
369+ ) -> List [Tuple [_K , "FRect" ]]: ...
370+
200371RectType = Rect
372+ FRectType = FRect
373+
0 commit comments