Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -928,11 +928,11 @@ def predict(
|
|
928 |
|
929 |
# Calculate actual text width from the path's bounds
|
930 |
text_bbox = path.bbox(paths)
|
931 |
-
text_width = text_bbox[2] - text_bbox[0] # xmax - xmin
|
932 |
-
|
933 |
# Calculate center point of inner tool contours
|
934 |
center_x = (inner_min_x + inner_max_x) / 2.0
|
935 |
-
|
936 |
# Calculate starting x position for truly centered text
|
937 |
text_x = center_x - (text_width / 2.0)
|
938 |
|
|
|
928 |
|
929 |
# Calculate actual text width from the path's bounds
|
930 |
text_bbox = path.bbox(paths)
|
931 |
+
#text_width = text_bbox[2] - text_bbox[0] # xmax - xmin
|
932 |
+
text_width = text_bbox.width
|
933 |
# Calculate center point of inner tool contours
|
934 |
center_x = (inner_min_x + inner_max_x) / 2.0
|
935 |
+
text_width = text_bbox.extmax.x - text_bbox.extmin.x
|
936 |
# Calculate starting x position for truly centered text
|
937 |
text_x = center_x - (text_width / 2.0)
|
938 |
|