songflower

reflow bitmap sheet music to a different paper format
git clone https://a3nm.net/git/songflower/
Log | Files | Refs | README | LICENSE

commit dfa1cffd5f787c370f194a7798e9d925d915826f
parent e8bf45b82c5e2f3fde174c28d24e7d42c8ffed1e
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri,  6 Sep 2019 00:05:40 +0200

a fit faster

Diffstat:
splith.py | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/splith.py b/splith.py @@ -120,11 +120,18 @@ for i in range(len(contiguous_sort)): break # we are under threshold and have enough cuts final_cuts.append((pos, height)) # mark the covered regions - for j in range(max(0, pos-floor(1.*args.maxheight/2)), - min(in_h, pos+height+ceil(1.*args.maxheight/2))): + for j in range(pos, max(0, pos-floor(1.*args.maxheight/2)), -1): if not covered2[j]: ncovered2 += 1 covered2[j] = True + else: + break + for j in range(pos, min(in_h, pos+height+ceil(1.*args.maxheight/2))): + if not covered2[j]: + ncovered2 += 1 + covered2[j] = True + else: + break final_cuts = sorted(final_cuts)