Skip to content

Commit 650dc63

Browse files
Merge branch 'main' into feat/custom-focal-point
2 parents 2814d46 + f655182 commit 650dc63

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix: Remove buttons in screenshots

examples/00-basic-pyvista-examples/plain_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
pl.plot(mesh)
7171

7272
# Show the plotter
73-
pl.show(screenshot="screenshot.png")
73+
pl.show()
7474

7575

7676
######################

src/ansys/tools/visualization_interface/backends/pyvista/widgets/screenshot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ def callback(self, state: bool) -> None:
6767
This method provides a callback function for the screenshot widget.
6868
It is called every time the screenshot widget is clicked.
6969
"""
70+
for widget in self.plotter._widgets:
71+
widget._button.GetRepresentation().SetVisibility(0)
72+
self._plotter._pl.scene.render()
7073
self.plotter._pl.scene.screenshot("screenshot.png")
74+
for widget in self.plotter._widgets:
75+
widget._button.GetRepresentation().SetVisibility(1)
76+
self._plotter._pl.scene.render()
7177

7278
def update(self) -> None:
7379
"""Define the configuration and representation of the screenshot widget button."""

0 commit comments

Comments
 (0)