Browse Source

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

pull/1/head
Darks 3 years ago
parent
commit
7bc01cfb39
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      sprite-optimizer.py

+ 4
- 4
sprite-optimizer.py View File

@ -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