You are not logged in.

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: 93

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,003

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

Tuesday, February 18th 2020, 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

5

Wednesday, March 4th 2020, 6:00pm

Hi,

thanks for reporting!
This will be fixed in version 1.20.5, then nested styles will be fully supported.

Best regards,
Klaus

6

Tuesday, March 10th 2020, 10:09pm

Woohoo, you made my day!
Thx