Skin Elements no longer aligning accurately, off by 1

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
mbb
Posts: 203
Joined: Mon Oct 19, 2009 11:42 pm

Skin Elements no longer aligning accurately, off by 1

Post by mbb » Sat Dec 01, 2018 7:02 am

Pano2VR v6.01, Win10 64bit

This is a strange one- all of a sudden, I have noticed that certain skin elements that were aligned perfectly before are now of by 1 pixel or so.

I have round svg icons with a rounded rect as an outline. all elements are set at center. these were aligning perfectly before and now they are off by 1 pixel. Which looks sloppy in the tour UI.

Even started a brand new empty skin, inserted an svg icon (GG silhoutte icon), sized it down to a smaller even number, put a rounded rect behind it slightly bigger by a few (even) pixels, had everything set to "center" and they are not aligned with each other.

I did not have problems with this in the past.

mbb
Posts: 203
Joined: Mon Oct 19, 2009 11:42 pm

Re: Skin Elements no longer aligning accurately, off by 1

Post by mbb » Sat Dec 01, 2018 7:28 am

aaand it gets stranger.. uploading the vr tour to the web server and viewing it from there shows the skin elements in question aligning properly.

Opening P2VR again and loading it locally shows the misalignment (in browser and skin editor). Same browser (Firefox), same output files..

Really have no idea what's going on at this point.

User avatar
Hopki
Gnome
Posts: 8913
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Re: Skin Elements no longer aligning accurately, off by 1

Post by Hopki » Tue Dec 04, 2018 4:02 pm

Hi,
In Pano2VR 6 the skin uses the same rules for element alignment as CSS.
Before it copied how Flash treated borders.

So if you have two rectangles anchored top left, 100 x 100px which are both parent elements and are in the same position and both with border 0 stacked onto of each other then one will cover the other.
If you add a 5px border to the back rectangle you will see it move to the right and down as its anchored to top left.
The border is of course adding size the the rectangle.

If you then reset the test and anchored both middle the the back rectangles border will scale up from the centre.

If you reset the test and then moved front rectangle as a child of the back with it anchored centre and the parent anchored top left it will still scale up evenly.

If this is not what you are seeing then maybe send in a simple project that shows the issue as tested on both Windows and Mac and see no real issue.
But then I can. not see without your project what you are doing.

Regards,
Hopki

mbb
Posts: 203
Joined: Mon Oct 19, 2009 11:42 pm

Re: Skin Elements no longer aligning accurately, off by 1

Post by mbb » Tue Dec 04, 2018 10:40 pm

This has to do with elements that are *centered* over each other, not top right, left, bottom etc.

Here's a skin example with two elements that should be centered but do not appear as such-
alignment_test.ggsk
(1.42 KiB) Downloaded 15 times

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests