farahshun / scxmlgui

Automatically exported from code.google.com/p/scxmlgui
0 stars 0 forks source link

Serialized location information subtly changing floating point value #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load a SCXML document that has preserved layout information
2. Save the document as a new file.
3. Diff the two files.

EXPECTED: No changes in the file (other than, perhaps, whitespace)
ACTUAL: The serialized location information often shifts slightly, causing 
noise in revision control.

Two examples diffs from my file:
-   <state id="LaunchingError"><!--   node-size-and-position 
x=150.0000000000001 y=60.000000000000114 w=90.0 h=30.0  -->
+   <state id="LaunchingError"><!--   node-size-and-position 
x=150.0000000000001 y=60.00000000000023 w=90.0 h=30.0  -->

-   <state id="ResumeDialog"><!--   node-size-and-position x=20.0 y=80.0 w=80.0 
h=20.0  -->
+   <state id="ResumeDialog"><!--   node-size-and-position x=20.000000000000227 
y=80.0 w=80.0 h=20.0  -->

It looks like the numbers are being rounded to tenths and then serialized using 
a simple float->string conversion, instead of having the serialization use 
something like sprintf() that would guarantee the characters output.

Original issue reported on code.google.com by Phrog...@gmail.com on 5 Mar 2013 at 8:48

GoogleCodeExporter commented 9 years ago

Original comment by fmorbini on 6 Mar 2013 at 12:48

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r184.

Original comment by fmorbini on 7 Mar 2013 at 5:35