mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Disallow dropping curves onto other curves
* Dropping curves between other curves works much better with this change.
This commit is contained in:
@@ -229,7 +229,7 @@ void RimMultiPlot::removePlot( RimPlot* plot )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMultiPlot::movePlotsToThis( const std::vector<RimPlot*>& plotsToMove, RimPlot* plotToInsertAfter )
|
||||
void RimMultiPlot::movePlotsToThis( const std::vector<RimPlot*>& plotsToMove, int insertAtPosition )
|
||||
{
|
||||
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
|
||||
{
|
||||
@@ -245,12 +245,16 @@ void RimMultiPlot::movePlotsToThis( const std::vector<RimPlot*>& plotsToMove, Ri
|
||||
}
|
||||
}
|
||||
|
||||
size_t insertionStartIndex = 0;
|
||||
if ( plotToInsertAfter ) insertionStartIndex = this->plotIndex( plotToInsertAfter ) + 1;
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
|
||||
{
|
||||
this->insertPlot( plotsToMove[tIdx], insertionStartIndex + tIdx );
|
||||
if ( insertAtPosition >= 0 )
|
||||
{
|
||||
this->insertPlot( plotsToMove[tIdx], (size_t)insertAtPosition + tIdx );
|
||||
}
|
||||
else
|
||||
{
|
||||
this->addPlot( plotsToMove[tIdx] );
|
||||
}
|
||||
}
|
||||
|
||||
this->updateLayout();
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
void addPlot( RimPlot* plot );
|
||||
void insertPlot( RimPlot* plot, size_t index );
|
||||
void removePlot( RimPlot* plot );
|
||||
void movePlotsToThis( const std::vector<RimPlot*>& plots, RimPlot* plotToInsertAfter );
|
||||
void movePlotsToThis( const std::vector<RimPlot*>& plots, int insertAtPosition );
|
||||
|
||||
size_t plotCount() const;
|
||||
size_t plotIndex( const RimPlot* plot ) const;
|
||||
|
||||
Reference in New Issue
Block a user