Hiding and Unhiding polygon using the setVisible() method does not bring back the perimeter lines

Anand shared this problem 10 months ago
Not a Problem

for this GeoGebra embed, I am controlling the animation using JS from React. I have the need to hide the pyramid shown ( variable "a" ) when the cross section is shown and then brought back when the slicing plane moves back.

i am using the setVisible property of the GGBApplet to get this done, using setVisible('a', false) and setVisible('a',true).

Why do the lines go missing, for the GeoGebra item linked here, you can open console and paste ggbApplet.setVisible('a', false) followed by ggbApplet.setVisible('a', true) to recreate the bug.

the border lines of the pyramid will come back if we make a selection of the pyramid form the action bar on the left side of the screen.

1 not so good workaround i found is to use setLineStyle('a', 0); which manually sets the line styling but this doesn't seem the suitable way.

Require urgent attention.

Comments (3)


Try using "Condition to Show Object" with a boolean then you can just do ggbApplet.setValue(bool, 0)


Thanks Michael. The solution worked,

But just a query, is the above mentioned behaviour expected or is it a some sort of issue which needs to be reported with the GeoGebra team ?

Hiding and unHiding an object is generally expected to preserve its pre-existing state.


I doubt we'll change that

© 2020 International GeoGebra Institute