sozi-projects/Sozi

Misplaced objects

Closed this issue · 12 comments

Discussed in #575

Hello.
I have some Sozi presentation in which I carefully plan every move.
In Sozi I see them working perfectly.
Though, when I look at them in a browser, some of the objects are misplaced and enlarged, so the figures are all messed up.
I can't figure out what's wrong.
Here they are.
Can anyone help me?
PO_prisma.zip

Moreover, I tried rendering it in Firefox and Chrome, both under Linux, same result.

I noticed that if I manually save the presentation after the first four or five frames, the object are placed exactly where they're supposed to be.
Adding a step or simply opening the svg again in Sozi (thus causing an overwrite of the existing html files) corrupts the presentation which now shows misplaced lines even if I don't change anything.
I'm pretty puzzled.
Working on Ubuntu 21.04 64bit
Inkscape 1.0.2
Sozi 2.11.14 (latest release)
Firefox 94.0
Chrome 95.0.4638.54

Thanks for reporting the issue.
I will check the example.

Thank you.
Meanwhile, I discovered that I can somewhat fix a faux-pas selecting a layer in a single frame and resetting its geometry with CTRL-R.
Though, this works only if I don't change the initial view in the first frame; I have to stick the zoom and pan I am presented with when opening the svg file.

And finally I succeeded in fixing it, but I needed to reset layer geometry at least five times for objects named:
path251 (main problem, it keeps shifting down left and changing size every time Sozi saves)
path249
path154
path156
Every other object stays perfectly in place.

Here's the presentation, finally working.
https://alexmelillo.altervista.org/tecnodispense/PO_prisma.html
Now I'm figuring a way to preset the initial view in Inkscape so to be able to reset layer geometry every time Sozi shifts it somewhat.
Nonetheless, Sozi is a beautiful piece of software and it's pretty helpful in my teaching workflow.
Thank you.

I think I know what's going on.

In each frame, Sozi records the position of each layer relative to a reference graphic element that is chosen automatically. If it cannot find a suitable element, it falls back to absolute positioning.

When playing your presentation, I see a problem in frame 3, and in layer "seg".
In this layer, Sozi finds a horizontal segment and uses it as its reference element. Since this element's height is 0, Sozi cannot reliably compute the scaling factor to apply.
When playing the presentation, this frame will be correctly displayed only if the browser window has the same aspect ratio as in Sozi.

I will modify Sozi to prevent this situation. In the meantime, since you need precise positioning of your layers, I suggest that you use rectangles as "outline elements", as illustrated in the tutorial "Using layers".

In a future version, I think that your presentation could benefit from the feature called "Copy layer": currently, Sozi does not record the action and we sometimes need to apply it again when the original layer has changed.

Thank you very much for your answer.
Though, that element's height is not zero but 0,662 in Inkscape.

Screenshot

Though, that element's height is not zero but 0,662 in Inkscape.

That's right. Maybe my interpretation was wrong.
Issue #573 describes a similar problem that happens while transitioning to/from a frame with opacity=0. This is also the case in frame 3 of your presentation.

Thank you again,
Meanwhile, I referenced to the tutorial adding a rectangle wide as the whole sheet in that layer. It has no border and no filling, so it's practically invisible but now Sozi can track the position of each object and everything works perfectly.

You can try Sozi 21.12. It contains a fix that addresses this issue.
I cannot promise that it will automatically fix your existing presentations, but I hope it will prevent similar problems when you modify them or create new ones.

Great. Sure I will.
By the way, would you like some help in translating interface and documentation in Italian?
I'd be glad to help.

By the way, would you like some help in translating interface and documentation in Italian?

Sure! I think that the Italian translation of the user interface deserves to be completed: you will find instructions at https://sozi.baierouge.fr/pages/translate-editor.html

SInce I am in the process of writing a new documentation (see http://sozi.guide), I'm not sure that translating the current documentation would be worth the effort.

I'm closing this issue, but feel free to reopen it if you think the problem has not been fully fixed.