Skip to content

Commit 92eec0e

Browse files
committedJul 20, 2016
Revert "[labeling] Curved labels are now angled per character"
This reverts commit f6d07a3.
1 parent 4bcae06 commit 92eec0e

File tree

7 files changed

+3
-10
lines changed

7 files changed

+3
-10
lines changed
 

‎src/core/pal/feature.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,6 @@ LabelPosition* FeaturePart::curvedPlacementAtOffset( PointSet* path_positions, d
879879
delete slp;
880880
return nullptr;
881881
}
882-
// Shift the character downwards since the draw position is specified at the baseline
883-
// and we're calculating the mean line here
884-
double dist = 0.9 * li->label_height / 2;
885-
if ( orientation < 0 )
886-
dist = -dist;
887-
start_x += dist * cos( angle + M_PI_2 );
888-
start_y -= dist * sin( angle + M_PI_2 );
889882

890883
double render_angle = angle;
891884

@@ -1049,11 +1042,11 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition* >& lPos,
10491042
double angle_avg = atan2( sin_avg / li->char_num, cos_avg / li->char_num );
10501043
// displacement
10511044
if (( !reversed && ( flags & FLAG_ABOVE_LINE ) ) || ( reversed && ( flags & FLAG_BELOW_LINE ) ) )
1052-
positions.append( _createCurvedCandidate( slp, angle_avg, mLF->distLabel() + li->label_height / 2 ) );
1045+
positions.append( _createCurvedCandidate( slp, angle_avg, mLF->distLabel() ) );
10531046
if ( flags & FLAG_ON_LINE )
1054-
positions.append( _createCurvedCandidate( slp, angle_avg, 0 ) );
1047+
positions.append( _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 ) );
10551048
if (( !reversed && ( flags & FLAG_BELOW_LINE ) ) || ( reversed && ( flags & FLAG_ABOVE_LINE ) ) )
1056-
positions.append( _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 - mLF->distLabel() ) );
1049+
positions.append( _createCurvedCandidate( slp, angle_avg, -li->label_height - mLF->distLabel() ) );
10571050

10581051
// delete original candidate
10591052
delete slp;

Error rendering embedded code

Invalid image source.

Error rendering embedded code

Invalid image source.

Error rendering embedded code

Invalid image source.

Error rendering embedded code

Invalid image source.

Error rendering embedded code

Invalid image source.

Error rendering embedded code

Invalid image source.

0 commit comments

Comments
 (0)
Please sign in to comment.