Skip to content

Commit

Permalink
VisibleLayer: fix a bug in which the onVisibleChanged callback was ge…
Browse files Browse the repository at this point in the history
…tting fired before the state changed when using _visibleTiedToOpen==true, as in an ElevationLayer
  • Loading branch information
gwaldron committed Dec 20, 2024
1 parent 536e052 commit f1d7948
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/osgEarth/VisibleLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ VisibleLayer::setVisible(bool value)

updateNodeMasks();

onVisibleChanged.fire(this);

if (_visibleTiedToOpen)
{
if (value && !isOpen())
open();
else if (!value && isOpen())
close();
}

onVisibleChanged.fire(this);
}
}

Expand Down

0 comments on commit f1d7948

Please sign in to comment.