+ source_x = source_y = 0
+ if x < 0:
+ source_x = 0 - x
+ x = 0
+ if y < 0:
+ source_y = 0 - y
+ y = 0
+
+ buffer.alpha_composite(
+ image, (round(x), round(y)), source=(round(source_x), round(source_y))
+ )
+
+ # pylint: enable=too-many-locals,too-many-branches