Skip to content

Commit

Permalink
changes in the scalarbar2d
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Sep 13, 2024
2 parents 1f92adb + 3706ec2 commit 98d6036
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- add `plotter.reset_clipping_range()` to reset the camera clipping range based on the bounds of the visible actors #1170
- fix issue with find_cell() in #1095
- improvements to `volume.isosurface_discrete()` in #1180 by @snownontrace
- fix bug on video frame by resetting camera clipping range in #1180 by @snownontrace
- changes in the scalarbar2d object.


Expand Down
5 changes: 4 additions & 1 deletion vedo/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,9 @@ def screenshot(filename="screenshot.png", scale=1, asarray=False) -> Union["vedo
if not vedo.plotter_instance or not vedo.plotter_instance.window:
# vedo.logger.error("in screenshot(), rendering window is not present, skip.")
return vedo.plotter_instance ##########

if vedo.plotter_instance.renderer:
vedo.plotter_instance.renderer.ResetCameraClippingRange()

if asarray and scale == 1 and not vedo.plotter_instance.offscreen:
nx, ny = vedo.plotter_instance.window.GetSize()
Expand All @@ -1796,7 +1799,7 @@ def screenshot(filename="screenshot.png", scale=1, asarray=False) -> Union["vedo
narr = np.flip(narr, axis=0)
return narr ##########


###########################
if filename.endswith(".pdf"):
writer = vtki.new("GL2PSExporter")
writer.SetRenderWindow(vedo.plotter_instance.window)
Expand Down

0 comments on commit 98d6036

Please sign in to comment.