Skip to content

Commit ff28e6a

Browse files
committedAug 6, 2015
[pal] Shade all parts of label candidate as conflicting when
appropriate
1 parent 39c728b commit ff28e6a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎src/core/pal/labelposition.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,13 @@ namespace pal
377377
return feature->layer()->name();
378378
}
379379

380+
void LabelPosition::setConflictsWithObstacle( bool conflicts )
381+
{
382+
mHasObstacleConflict = conflicts;
383+
if ( nextPart )
384+
nextPart->setConflictsWithObstacle( conflicts );
385+
}
386+
380387
bool LabelPosition::costShrink( void *l, void *r )
381388
{
382389
return (( LabelPosition* ) l )->mCost < (( LabelPosition* ) r )->mCost;

‎src/core/pal/labelposition.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,10 @@ namespace pal
178178

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.