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.

Mael B.

Trainee

  • "Mael B." started this thread

Posts: 133

Location: France, Montpellier

  • Send private message

1

Thursday, February 1st 2018, 12:47pm

Bug with the New Combobox Plugin (combobox.xml)

Hi,

I noticed a small bug using the the New Combobox Plugin (combobox.xml) :
if combobox layer are set parent of an another layer which is too close to the border screen, the combobox does not open entirely :(

You can figure out of the problem by simply adding this code to the combobox-examples.xml (from example folder of krpano-1.19-pr14)

Source code

1
2
3
4
5
6
7
8
<action name="comboboxexamples" autorun="onstart">
loadscene(0);
set(layer[cbsettings].parent,top_combobox_container);
set(layer[cbscenes].parent,bottom_combobox_container);
</action>

<layer name="top_combobox_container" type="container" align="righttop"   y="0" keep="true" >  </layer>
<layer name="bottom_combobox_container" type="container" align="leftbottom" y="0"  keep="true" >  </layer>


By increasing 'y' value up to ~150 or setting to align="right" or align="left" for the container layers, the combobox open again correctly...
I assume a bug in the actions that 'find the available screen space above or below the combobox' in combobox.xml... but i'm not able to fix it.

2

Wednesday, April 25th 2018, 7:39pm

hi

experiencing the same problem

did you find a fix?

Thanks

Mael B.

Trainee

  • "Mael B." started this thread

Posts: 133

Location: France, Montpellier

  • Send private message

3

Thursday, April 26th 2018, 11:16am

I did not really find a good fix, but I realize that removing a part of the code in 'combobox.xml', it seems to work correctly when combobox layers are set parent of an another layer.

There is the part to remove (line 420 to 442):

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
		calc(top_overflow, -ly1 + global.area.pixely + openheight/2);
		calc(bottom_overflow, ly2 - global.area.pixely + openheight/2 - global.area.pixelheight);
		if(cb.parent,
			<!-- no vertical offset inside other layers, do only a height clipping -->
			Math.max(max_overflow, top_overflow, bottom_overflow, 0);
			sub(openheight, max_overflow);
		  ,
			if(iscentered,
				if(openheight GE (global.area.pixelheight - 20),
					set(yoffset,0);
				  ,
					if(top_overflow GT 0, calc(yoffset, cb.y + top_overflow); );
					if(bottom_overflow GT 0, calc(yoffset, cb.y - bottom_overflow); );
				);
			,
				indexoftxt(isbottomalign, get(cb_edge), 'bottom');
				if(space_above GT space_below,
					if(isbottomalign LT 0, calc(yoffset, cb.y - openheight + cbheight); );
				  ,
					if(isbottomalign GE 0, calc(yoffset, cb.y - openheight + cbheight); );
				);
			);
		);


I know it is a bad fix because this removed part could probably induces other problems in other situations *unsure*

4

Sunday, June 10th 2018, 8:24pm

Thank you *thumbup* ! it worked! Are you having trouble after removing the code?

Mael B.

Trainee

  • "Mael B." started this thread

Posts: 133

Location: France, Montpellier

  • Send private message

5

Monday, June 11th 2018, 3:54pm

Thank you *thumbup* ! it worked! Are you having trouble after removing the code?
no trouble noticed for my usage.

Alexey Tkachenko

Professional

Posts: 741

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

6

Tuesday, June 19th 2018, 10:13am

Hi)

I took a look at it and it seems that if you change the line 425

Source code

1
sub(openheight, max_overflow);
to

Source code

1
if(max_overflow LE 0, sub(openheight, max_overflow); );
it works fine.
Anyway, it seems better not to remove the whole code part (not the best practice, because it may influence some other usage cases).





Regards,

Alexey

Mael B.

Trainee

  • "Mael B." started this thread

Posts: 133

Location: France, Montpellier

  • Send private message

7

Tuesday, June 19th 2018, 11:07am

Anyway, it seems better not to remove the whole code part (not the best practice, because it may influence some other usage cases).
I totally agree *smile* So, thanks a lot for the correct code modification *thumbup*

Similar threads