Skip to content

Commit

Permalink
Revert "[labeling] Curved labels are now angled per character"
Browse files Browse the repository at this point in the history
This reverts commit f6d07a3.
  • Loading branch information
nyalldawson committed Jul 20, 2016
1 parent 4bcae06 commit 92eec0e
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/core/pal/feature.cpp
Expand Up @@ -879,13 +879,6 @@ LabelPosition* FeaturePart::curvedPlacementAtOffset( PointSet* path_positions, d
delete slp;
return nullptr;
}
// Shift the character downwards since the draw position is specified at the baseline
// and we're calculating the mean line here
double dist = 0.9 * li->label_height / 2;
if ( orientation < 0 )
dist = -dist;
start_x += dist * cos( angle + M_PI_2 );
start_y -= dist * sin( angle + M_PI_2 );

double render_angle = angle;

Expand Down Expand Up @@ -1049,11 +1042,11 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition* >& lPos,
double angle_avg = atan2( sin_avg / li->char_num, cos_avg / li->char_num );
// displacement
if (( !reversed && ( flags & FLAG_ABOVE_LINE ) ) || ( reversed && ( flags & FLAG_BELOW_LINE ) ) )
positions.append( _createCurvedCandidate( slp, angle_avg, mLF->distLabel() + li->label_height / 2 ) );
positions.append( _createCurvedCandidate( slp, angle_avg, mLF->distLabel() ) );
if ( flags & FLAG_ON_LINE )
positions.append( _createCurvedCandidate( slp, angle_avg, 0 ) );
positions.append( _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 ) );
if (( !reversed && ( flags & FLAG_BELOW_LINE ) ) || ( reversed && ( flags & FLAG_ABOVE_LINE ) ) )
positions.append( _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 - mLF->distLabel() ) );
positions.append( _createCurvedCandidate( slp, angle_avg, -li->label_height - mLF->distLabel() ) );

// delete original candidate
delete slp;
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92eec0e

Please sign in to comment.