Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[pal] Shade all parts of label candidate as conflicting when
appropriate
  • Loading branch information
nyalldawson committed Aug 6, 2015
1 parent 39c728b commit ff28e6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/core/pal/labelposition.cpp
Expand Up @@ -377,6 +377,13 @@ namespace pal
return feature->layer()->name();
}

void LabelPosition::setConflictsWithObstacle( bool conflicts )
{
mHasObstacleConflict = conflicts;
if ( nextPart )
nextPart->setConflictsWithObstacle( conflicts );
}

bool LabelPosition::costShrink( void *l, void *r )
{
return (( LabelPosition* ) l )->mCost < (( LabelPosition* ) r )->mCost;
Expand Down
3 changes: 2 additions & 1 deletion src/core/pal/labelposition.h
Expand Up @@ -178,9 +178,10 @@ namespace pal

/** Sets whether the position is marked as conflicting with an obstacle feature.
* @param conflicts set to true to mark candidate as being in conflict
* @note This method applies to all label parts for the candidate position.
* @see conflictsWithObstacle
*/
void setConflictsWithObstacle( bool conflicts ) { mHasObstacleConflict = conflicts; }
void setConflictsWithObstacle( bool conflicts );

/** Returns whether the position is marked as conflicting with an obstacle feature.
* @see setConflictsWithObstacle
Expand Down

0 comments on commit ff28e6a

Please sign in to comment.