@@ -1968,7 +1968,8 @@ def ReflectOverlap(
19681968 {Direction .left }, len (string ), string , overwrite = False
19691969 )
19701970 self .y += 1
1971- self .x , self .y = initial_x - (initial_x - left ) * 2 , initial_y
1971+ self .x = initial_x - (initial_x - left ) * 2 + overlap - 1
1972+ self .y = initial_y
19721973 elif direction == Direction .right :
19731974 self .y = self .top
19741975 right = max (self .right_indices )
@@ -1988,6 +1989,7 @@ def ReflectOverlap(
19881989 self .y = initial_y
19891990 elif direction == Direction .up :
19901991 self .y = self .top + overlap - 1
1992+ final_y = self .y - (initial_y - self .top )
19911993 for line , length , index in zip (
19921994 self .lines [:], self .lengths [:], self .indices [:]
19931995 ):
@@ -2001,10 +2003,11 @@ def ReflectOverlap(
20012003 )
20022004 self .y -= 1
20032005 self .x = initial_x
2004- self .y = initial_y * 3 - self . top * 2 - 1 + overlap
2006+ self .y = final_y
20052007 elif direction == Direction .down :
20062008 line_count = len (self .lines )
20072009 self .y = self .top + line_count * 2 - overlap - 1
2010+ final_y = self .y - (initial_y - self .top )
20082011 for line , length , index in zip (
20092012 self .lines [:], self .lengths [:], self .indices [:]
20102013 ):
@@ -2018,7 +2021,7 @@ def ReflectOverlap(
20182021 )
20192022 self .y -= 1
20202023 self .x = initial_x
2021- self .y = ( self . top + line_count ) * 2 - initial_y - 1 - overlap
2024+ self .y = final_y
20222025 else :
20232026 finished = False
20242027 if finished :
0 commit comments