You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, February 14th 2020, 10:59pm

1.20 regression - nested styles

Was working in 1.19 but not anymore in 1.20 :

I simplified the case, but 1.20 shows a critical regression on nested styles on my side. Maybe I'm mistaken but :

Source code

1
2
3
4
<style name="style1" /> 
<style name="style2" style="style1" /> 
<style name="style3" style="style2" url="myimage.jpg" ath="20" atv="20" />
<hotspot name="myhotspot" style="style3" />


works : the hotspot is shown at ath:20 and atv:20

Source code

1
2
3
4
 <style name="style1" />
 <style name="style2" style="style1" ath="20" atv="20" /> 
 <style name="style3" style="style2" url="myimage.jpg" />
<hotspot name="myhotspot" style="style3" />



this does not work, the hotspot is shown ath:0 and atv:0.


1.20 does not support nested styles anymore.


And hotspot finally says its style is "style1" (trace(get(hotspot[myhotspot].style) => "style1").


Best

a.pu

Trainee

Posts: 91

Location: Default city, Russia

Occupation: Vtour dev, design, UX and photography

  • Send private message

2

Saturday, February 15th 2020, 2:39pm

I like this trick!

Sometimes style declarations become really spaghetti long *g*

Zephyr

Professional

Posts: 1,002

Location: Netherlands

Occupation: Web developer

  • Send private message

3

Saturday, February 15th 2020, 2:56pm

You can combine several styles with a pipe |

<hotspot name="myhotspot" style="style1|style2|style3" />

or

<style name="style3|" style="style1|style2| />
<hotspot name="myhotspot" style="style3" />

4

Yesterday, 5:26pm

Thanks for the pipes, I'll try to stick with your 2nd example.

<style name="style3" style="style1|style2" />
<hotspot name="myhotspot" style="style3" />


I imagine my example was never meant to be working in 1.19 either and it was just luck.

But it seemed so straightforward and so easy in krpano's documentation : "When the xml element will be first created, all attributes defined at the <style> element will be copied to the element itself." I guess this sentence is wrong when the xml element is a style.


Thanks!

Florian