Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sozi json is not stable over load/save iterations induce presentations defect after several cycles. #688

Open
matclab opened this issue Oct 27, 2023 · 1 comment

Comments

@matclab
Copy link

matclab commented Oct 27, 2023

Summary of your problem or feature request

Sozi presentation is not stable in the time. Each time you save, some subtle changes appear in the json, I guess due to float rounding error.

After some iterations I have to check all the slide to correct the little (or sometimes big) offset either in the slide position or in the cutting shape.
It is a major drawback for longer presentations.

Version of Sozi and other relevant software

  • sozi 23.07
  • inkscape 1.3
  • arch linux 64 bits

Steps to reproduce the problem

Setup a presentation, save dozens of time and see that some slides are now off their initial position.

Expected behavior

Slide and cut position and dimensions stays stable upon saving over time.

Observed behavior

Some slides or cut get off their initial position, without moving them.

Hints and solutions (optional)

I vote for a float rounding problem, more or less perceptible depending upon the zoom level.

I'll try to make a minimal case to reproduce the problem.

@matclab
Copy link
Author

matclab commented Oct 31, 2023

A little example in two step

Which gives the following second frame:
image

And then I add an object (a spiral), which gives the following svg :

Which leads after automatic reload to the following test.sozi.json:
test.sozi.json modified without human intervention

And this second frame:
image

The svg diff is:

diff --git a/test.svg b/test.svg
index 3371f27..3963354 100644
--- a/test.svg
+++ b/test.svg
@@ -25,7 +25,7 @@
      inkscape:document-units="px"
      inkscape:zoom="4.966441"
      inkscape:cx="120.81086"
-     inkscape:cy="129.06627"
+     inkscape:cy="129.16694"
      inkscape:window-width="1920"
      inkscape:window-height="1034"
      inkscape:window-x="0"
@@ -81,4 +81,17 @@
        cy="96.971519"
        r="4.9238281" />
   </g>
+  <path
+     sodipodi:type="spiral"
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linej>
+     id="path2"
+     sodipodi:cx="29.607037"
+     sodipodi:cy="70.048569"
+     sodipodi:expansion="1"
+     sodipodi:revolution="3"
+     sodipodi:radius="11.523953"
+     sodipodi:argument="-18.325956"
+     sodipodi:t0="0"
+     d="m 29.607037,70.048569 c 0.500383,0.288896 -0.142556,0.817037 -0.480166,0.831669 -0.914901,0.0396>
+     transform="translate(2.5327064,1.8754908)" />
 </svg>

But the json diff is:

diff --git a/test.sozi.json b/test.sozi.json
index e3fdd70..14cc6db 100644
--- a/test.sozi.json
+++ b/test.sozi.json
@@ -60,7 +60,7 @@
         },
         "__sozi_auto__": {
           "link": false,
-          "referenceElementId": "",
+          "referenceElementId": "path2",
           "outlineElementId": "",
           "transitionTimingFunction": "linear",
           "transitionRelativeZoom": 0,
@@ -84,8 +84,8 @@
         "text2": {
           "cx": 40.40368962287903,
           "cy": 76.95401000976562,
-          "width": 86.48829650878906,
-          "height": 49.88267517089844,
+          "width": 52.18732332746864,
+          "height": 8.05282031871704,
           "opacity": 1,
           "angle": 0,
           "clipped": false,
@@ -132,8 +132,8 @@
         "text2": {
           "deltaX": -36.785534620285034,
           "deltaY": -5.417633056640625,
-          "widthFactor": 86.48829650878906,
-          "heightFactor": 49.88267517089844,
+          "widthFactor": 52.18732332746864,
+          "heightFactor": 8.05282031871704,
           "deltaAngle": 0
         },
         "yellow": {
@@ -142,6 +142,13 @@
           "widthFactor": 8.782627491570807,
           "heightFactor": 6.584591792163595,
           "deltaAngle": 0
+        },
+        "__sozi_auto__": {
+          "deltaX": 7.308123826980591,
+          "deltaY": 5.985389709472656,
+          "widthFactor": 4.22710493293324,
+          "heightFactor": 2.689211458086764,
+          "deltaAngle": 0
         }
       }
     },
@@ -193,7 +200,7 @@
         "layer1": {
           "cx": 77.17973619701569,
           "cy": 82.54889413239681,
-          "width": 1.470531069364162,
+          "width": 1.4705310693641622,
           "height": 1.1025,
           "opacity": 1,
           "angle": 0,
@@ -206,8 +213,8 @@
         "text2": {
           "cx": 77.17973619701569,
           "cy": 82.54889413239681,
-          "width": 1.470531069364162,
-          "height": 1.1025,
+          "width": 1,
+          "height": 1,
           "opacity": 1,
           "angle": 0,
           "clipped": false,
@@ -232,8 +239,8 @@
         "__sozi_auto__": {
           "cx": 77.17973619701569,
           "cy": 82.54889413239681,
-          "width": 1.470531069364162,
-          "height": 1.1025,
+          "width": 1,
+          "height": 1,
           "opacity": 1,
           "angle": 0,
           "clipped": false,
@@ -254,8 +261,8 @@
         "text2": {
           "deltaX": -0.009488046148376839,
           "deltaY": 0.17725106599056062,
-          "widthFactor": 1.470531069364162,
-          "heightFactor": 1.1025,
+          "widthFactor": 1,
+          "heightFactor": 1,
           "deltaAngle": 0
         },
         "yellow": {
@@ -268,8 +275,8 @@
         "__sozi_auto__": {
           "deltaX": -0.009488046148376839,
           "deltaY": 0.17725106599056062,
-          "widthFactor": 1.470531069364162,
-          "heightFactor": 1.1025,
+          "widthFactor": 1,
+          "heightFactor": 1,
           "deltaAngle": 0
         }
       }
@@ -311,7 +318,7 @@
         },
         "__sozi_auto__": {
           "link": false,
-          "referenceElementId": "text1",
+          "referenceElementId": "path2",
           "outlineElementId": "",
           "transitionTimingFunction": "linear",
           "transitionRelativeZoom": 0,
@@ -335,8 +342,8 @@
         "text2": {
           "cx": 40.778503475571526,
           "cy": 64.39774594456773,
-          "width": 86.48829650878908,
-          "height": 64.84279651579853,
+          "width": 52.18732332746865,
+          "height": 10.467910702782225,
           "opacity": 1,
           "angle": 0,
           "clipped": false,
@@ -346,7 +353,7 @@
           "clipHeightFactor": 1
         },
         "yellow": {
-          "cx": -1.4483764830473769,
+          "cx": -1.448376483047376,
           "cy": 123.8143148248886,
           "width": 140.880321462301,
           "height": 105.62208282980747,
@@ -383,8 +390,8 @@
         "text2": {
           "deltaX": -36.41072076759254,
           "deltaY": -17.97389712183852,
-          "widthFactor": 86.48829650878908,
-          "heightFactor": 64.84279651579853,
+          "widthFactor": 52.18732332746865,
+          "heightFactor": 10.467910702782225,
           "deltaAngle": 0
         },
         "yellow": {
@@ -395,10 +402,10 @@
           "deltaAngle": 0
         },
         "__sozi_auto__": {
-          "deltaX": 0.37481313743676026,
-          "deltaY": -3.2374927028932063,
-          "widthFactor": 1.0000000000000002,
-          "heightFactor": 2.0752927396695933,
+          "deltaX": 7.682937679673088,
+          "deltaY": -6.570874355725238,
+          "widthFactor": 4.22710493293324,
+          "heightFactor": 3.495722528257764,
           "deltaAngle": 0
         }
       }
@@ -440,7 +447,7 @@
         },
         "__sozi_auto__": {
           "link": false,
-          "referenceElementId": "text1",
+          "referenceElementId": "path2",
           "outlineElementId": "",
           "transitionTimingFunction": "easeInOut",
           "transitionRelativeZoom": 0,
@@ -464,8 +471,8 @@
         "text2": {
           "cx": 32.002828613301865,
           "cy": 71.6137976001756,
-          "width": 32.59652934576432,
-          "height": 24.438568046878558,
+          "width": 19.668853301415776,
+          "height": 3.9452454515323483,
           "opacity": 1,
           "angle": 0,
           "clipped": false,
@@ -475,9 +482,9 @@
           "clipHeightFactor": 1
         },
         "yellow": {
-          "cx": -15.743026112544287,
+          "cx": -15.743026112544285,
           "cy": 135.5685025932568,
-          "width": 53.096311502908826,
+          "width": 53.09631150290883,
           "height": 39.80785217769546,
           "opacity": 1,
           "angle": 0,
@@ -512,8 +519,8 @@
         "text2": {
           "deltaX": -45.1863956298622,
           "deltaY": -10.757845466230648,
-          "widthFactor": 32.59652934576432,
-          "heightFactor": 24.438568046878558,
+          "widthFactor": 19.668853301415776,
+          "heightFactor": 3.9452454515323483,
           "deltaAngle": 0
         },
         "yellow": {
@@ -524,10 +531,10 @@
           "deltaAngle": 0
         },
         "__sozi_auto__": {
-          "deltaX": -8.4008617248329,
-          "deltaY": 3.978558952714664,
-          "widthFactor": 0.37688948287300134,
-          "heightFactor": 0.7821560074641671,
+          "deltaX": -1.0927371825965722,
+          "deltaY": 0.6451772998826328,
+          "widthFactor": 1.5931513922231215,
+          "heightFactor": 1.3175010559425695,
           "deltaAngle": 0
         }
       }
@@ -536,7 +543,7 @@
   "elementsToHide": [],
   "customFiles": [],
   "selectedFrames": [
-    "frame2477"
+    "frame6152"
   ],
   "selectedLayers": [
     "layer1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants