| ... |
... |
@@ -106,7 +106,7 @@ def generate_avatar(letters: str, |
|
106
|
106
|
context.set_operator(cairo.Operator.OVER)
|
|
107
|
107
|
PangoCairo.show_layout(context, layout)
|
|
108
|
108
|
|
|
109
|
|
- return context.get_target() # pyright: ignore
|
|
|
109
|
+ return context.get_target()
|
|
110
|
110
|
|
|
111
|
111
|
|
|
112
|
112
|
@lru_cache(maxsize=None)
|
| ... |
... |
@@ -183,7 +183,7 @@ def add_status_to_avatar(surface: cairo.ImageSurface, |
|
183
|
183
|
context.set_line_width(clip_radius / 4)
|
|
184
|
184
|
context.stroke()
|
|
185
|
185
|
|
|
186
|
|
- return context.get_target() # pyright: ignore
|
|
|
186
|
+ return context.get_target()
|
|
187
|
187
|
|
|
188
|
188
|
|
|
189
|
189
|
@lru_cache(maxsize=128)
|
| ... |
... |
@@ -220,7 +220,7 @@ def get_show_circle(show: Union[str, types.PresenceShowT], |
|
220
|
220
|
context.set_line_width(size / 10)
|
|
221
|
221
|
context.stroke()
|
|
222
|
222
|
|
|
223
|
|
- return context.get_target() # pyright: ignore
|
|
|
223
|
+ return context.get_target()
|
|
224
|
224
|
|
|
225
|
225
|
|
|
226
|
226
|
def fit(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface:
|
| ... |
... |
@@ -243,7 +243,7 @@ def fit(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface: |
|
243
|
243
|
context.scale(factor, factor)
|
|
244
|
244
|
context.set_source_surface(square_surface, 0, 0)
|
|
245
|
245
|
context.paint()
|
|
246
|
|
- return context.get_target() # pyright: ignore
|
|
|
246
|
+ return context.get_target()
|
|
247
|
247
|
|
|
248
|
248
|
|
|
249
|
249
|
def square(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface:
|
| ... |
... |
@@ -267,7 +267,7 @@ def square(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface: |
|
267
|
267
|
|
|
268
|
268
|
context.set_source_surface(surface, x_pos, y_pos)
|
|
269
|
269
|
context.paint()
|
|
270
|
|
- return context.get_target() # pyright: ignore
|
|
|
270
|
+ return context.get_target()
|
|
271
|
271
|
|
|
272
|
272
|
|
|
273
|
273
|
def clip(surface: cairo.ImageSurface, mode: str) -> cairo.ImageSurface:
|
| ... |
... |
@@ -297,7 +297,7 @@ def clip_circle(surface: cairo.ImageSurface) -> cairo.ImageSurface: |
|
297
|
297
|
context.clip()
|
|
298
|
298
|
context.paint()
|
|
299
|
299
|
|
|
300
|
|
- return context.get_target() # pyright: ignore
|
|
|
300
|
+ return context.get_target()
|
|
301
|
301
|
|
|
302
|
302
|
|
|
303
|
303
|
def round_corners(surface: cairo.ImageSurface) -> cairo.ImageSurface:
|
| ... |
... |
@@ -328,7 +328,7 @@ def round_corners(surface: cairo.ImageSurface) -> cairo.ImageSurface: |
|
328
|
328
|
|
|
329
|
329
|
context.paint()
|
|
330
|
330
|
|
|
331
|
|
- return context.get_target() # pyright: ignore
|
|
|
331
|
+ return context.get_target()
|
|
332
|
332
|
|
|
333
|
333
|
|
|
334
|
334
|
def convert_to_greyscale(surface: cairo.ImageSurface) -> cairo.ImageSurface:
|
| ... |
... |
@@ -341,7 +341,7 @@ def convert_to_greyscale(surface: cairo.ImageSurface) -> cairo.ImageSurface: |
|
341
|
341
|
context.set_source_rgba(1, 1, 1, 0.5)
|
|
342
|
342
|
context.rectangle(0, 0, surface.get_width(), surface.get_height())
|
|
343
|
343
|
context.fill()
|
|
344
|
|
- return context.get_target() # pyright: ignore
|
|
|
344
|
+ return context.get_target()
|
|
345
|
345
|
|
|
346
|
346
|
|
|
347
|
347
|
class AvatarStorage(metaclass=Singleton):
|