Controlling precision of generated floats in svg

0 votes
asked Jul 15 in Question / help by baerrach2 (160 points)

I'm building a gastby plugin to integrate plantuml with their remark/mdx generation.


Everything works fine.

My test cases are storing the generated svg's to do textual diffs against to check for bugs.

On two different windows machines using the same version of Java:

$ java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)

will produces different results.

Here is just one example:

    - <g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 226.9)\">
    + <g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 226.895)\">

You can see the precision in the translate, in the original file was "226.9" and in the newly generated file "226.895"

I've downloaded the code and had a quick look but its too much for me to locate how the output is generated.

I can see no option available to limit the output precision so that I would have more chances of getting stable output for diff comparison.

Is this something that I can force plantuml to do?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.