The owner of the this repo would need to go to https://travis-ci.org/profile and flip the repository switch __on__ to enable free automated flake8 testing of each pull request.
The simulation window is scaled to fill the available space on the screen. In
the Params dialog, the simulation window sits to the right of the Params window
and fills the remaining space.
There is no __sys.stderr_backup__ defined in the [Python sys] module. __save_stderr()__ adds a variable by that name which is a bit unconventional but it does work. This PR changes __restore_stderr()__ to read that data from the same variable. Without this change, __restore_stderr()__ will probably raise a NameError at runtime because __stderr_backup__ is an undefined name.
flake8 testing of https://github.com/lexelby/inkstitch on Python 2.7.14
$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./embroider_params.py:748:18: F821 undefined name 'stderr_backup'
sys.stderr = stderr_backup
^
```
The viewBox effectively adds global scaling and translation to all shapes in
the SVG. Borrowing from inkscape-silhouette, we construct a transform from
the viewBox and apply it to all objects.
When adding the stitch plan into the SVG, we need to compensate for this
implied transformation, which we do by adding its inverse as a transform
on the stitch plan polylines.
All of this allows us to do away with the nonstandard 10 pixels per mm that
was previously hardcoded into inkstitch. Old designs can add a viewBox to
switch from 10 pixels per mm to the standard 96 ppi that Inkscape uses.
Switching to a cooperative model. This has the downside that a long
patch computation will cause the simulate window to take longer to
update, but in practice the longest this will be is a couple of
seconds (for a very complicated autofill region).
The problem with this approach is that sometimes the SystemExit happens down
inside shapely and it complains bitterly (on stderr). May have to rethink.