3morrrrr commited on
Commit
772ccd1
·
verified ·
1 Parent(s): 656db99

Update hand.py

Browse files
Files changed (1) hide show
  1. hand.py +2 -3
hand.py CHANGED
@@ -135,9 +135,8 @@ class Hand(object):
135
  strokes[:, 1] *= -1
136
  strokes[:, :2] -= strokes[:, :2].min() + initial_coord
137
 
138
- # Adjust centering to make text larger relative to the canvas
139
- horizontal_padding = 50 # Fixed padding instead of centering
140
- strokes[:, 0] += horizontal_padding
141
 
142
  prev_eos = 1.0
143
  p = "M{},{} ".format(0, 0)
 
135
  strokes[:, 1] *= -1
136
  strokes[:, :2] -= strokes[:, :2].min() + initial_coord
137
 
138
+ # Center the text horizontally on the canvas (original centering logic)
139
+ strokes[:, 0] += (view_width - strokes[:, 0].max()) / 2
 
140
 
141
  prev_eos = 1.0
142
  p = "M{},{} ".format(0, 0)