mirror of
https://github.com/leozide/leocad
synced 2025-01-13 08:01:38 +01:00
Only draw track connections when focused.
This commit is contained in:
parent
7fd23dab4f
commit
41097f8489
3 changed files with 6 additions and 6 deletions
|
@ -166,7 +166,7 @@ std::optional<lcMatrix44> lcTrainTrackInfo::GetPieceInsertTransform(lcPiece* Cur
|
|||
if (FocusSection == LC_PIECE_SECTION_POSITION || FocusSection == LC_PIECE_SECTION_INVALID)
|
||||
{
|
||||
for (ConnectionIndex = 0; ConnectionIndex < CurrentTrackInfo->GetConnections().size(); ConnectionIndex++)
|
||||
if (CurrentPiece->IsTrainTrackConnectionVisible(ConnectionIndex))
|
||||
if (!CurrentPiece->IsTrainTrackConnected(ConnectionIndex))
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -375,7 +375,7 @@ void lcViewManipulator::DrawTrainTrack(lcPiece* Piece, lcContext* Context, float
|
|||
|
||||
for (quint32 ConnectionIndex = 0; ConnectionIndex < Connections.size(); ConnectionIndex++)
|
||||
{
|
||||
if (!Piece->IsTrainTrackConnectionVisible(ConnectionIndex))
|
||||
if (Piece->IsTrainTrackConnected(ConnectionIndex))
|
||||
continue;
|
||||
|
||||
const lcMatrix44& Transform = Connections[ConnectionIndex].Transform;
|
||||
|
@ -966,7 +966,7 @@ std::pair<lcTrackTool, quint32> lcViewManipulator::UpdateSelectMove()
|
|||
|
||||
for (quint32 ConnectionIndex = 0; ConnectionIndex < Connections.size(); ConnectionIndex++)
|
||||
{
|
||||
if (!Piece->IsTrainTrackConnectionVisible(ConnectionIndex))
|
||||
if (Piece->IsTrainTrackConnected(ConnectionIndex))
|
||||
continue;
|
||||
|
||||
const lcMatrix44& Transform = Connections[ConnectionIndex].Transform;
|
||||
|
|
|
@ -150,9 +150,9 @@ public:
|
|||
UpdateMesh();
|
||||
}
|
||||
|
||||
bool IsTrainTrackConnectionVisible(int ConnectionIndex) const
|
||||
bool IsTrainTrackConnected(int ConnectionIndex) const
|
||||
{
|
||||
return !mTrainTrackConnections[ConnectionIndex];
|
||||
return mTrainTrackConnections[ConnectionIndex];
|
||||
}
|
||||
|
||||
void SetTrainTrackConnections(std::vector<bool>&& Connections)
|
||||
|
@ -353,7 +353,7 @@ protected:
|
|||
|
||||
bool AreTrainTrackConnectionsVisible() const
|
||||
{
|
||||
return IsSelected();
|
||||
return IsFocused();
|
||||
}
|
||||
|
||||
void DrawTrainTrackInterface(lcContext* Context, const lcMatrix44& WorldMatrix) const;
|
||||
|
|
Loading…
Reference in a new issue