Correction d'un bug plutôt gênant :E

pull/1/head
Darks 4 years ago
parent f10367b542
commit 7bc01cfb39
  1. 8
      sprite-optimizer.py

@ -126,11 +126,11 @@ def get_best_solution(img, lines):
def generate_code(lines, args):
str_x, str_y = "{", "{"
for (xa, yb), (x, y) in lines:
for (xa, ya), (x, y) in lines:
x, y = x + int(args.offset[0]), y + int(args.offset[1])
a, b = xa - x + int(args.offset[0]), yb - y + int(args.offset[1])
str_x += "{}, ".format(get_coord(x, a))
str_y += "{}, ".format(get_coord(y, b))
xa, ya = xa + int(args.offset[0]), ya + int(args.offset[1])
str_x += "{}, ".format(get_coord(x, xa))
str_y += "{}, ".format(get_coord(y, xb))
str_x = str_x[:-2] + "}"
str_y = str_y[:-2] + "}"

Loading…
Cancel
Save