mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Remove impossible to hit code path - distance is never < 0
This commit is contained in:
parent
0b451b2514
commit
3d9386b11b
@ -967,18 +967,6 @@ int FeaturePart::createCandidatesAlongLineNearMidpoint( QList<LabelPosition *> &
|
||||
|
||||
LabelPosition *FeaturePart::curvedPlacementAtOffset( PointSet *path_positions, double *path_distances, int &orientation, int index, double distance, bool &reversed, bool &flip )
|
||||
{
|
||||
// Check that the given distance is on the given index and find the correct index and distance if not
|
||||
while ( distance < 0 && index > 1 )
|
||||
{
|
||||
index--;
|
||||
distance += path_distances[index];
|
||||
}
|
||||
|
||||
if ( index <= 1 && distance < 0 ) // We've gone off the start, fail out
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Same thing, checking if we go off the end
|
||||
while ( index < path_positions->nbPoints && distance > path_distances[index] )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user