almosr / android-svg-code-render

Convert SVG files into Java source and use it in your Android app
Apache License 2.0
24 stars 3 forks source link

Unnecessary Matrix, float[], Path and Paint instances #68

Closed bartek-wesolowski closed 8 years ago

bartek-wesolowski commented 8 years ago

Does the generated code have to contain co many variable declarations? Couldn't there just be one Matrix/Path/Paint being reset to new values every time a change is necessary? E.g. the Matrix class has setValues and reset methods which allow Matrix modifications. Couldn't the generator just do the necessary multiplications and then just print out the result instead of printing the multiplications? Perhaps the example will be better with the Paint class. Couldn't there just be a couple of them (for text, strokes, fillings, etc.) which would be modified every time a new color was needed (with the setColor method)? That's what I was doing in my generator and it worked like a charm.

almosr commented 8 years ago

It is not necessary, it just too complicated to find out which instances are depending on which ones.

Anyway, this is a duplicate of [#57].