[QGIS-trac] Re: [Quantum GIS] #3643: wrong direction of label direction symbol

Quantum GIS qgis at qgis.org
Tue Mar 29 08:59:51 EDT 2011


#3643: wrong direction of label direction symbol
-----------------------------------------------------+----------------------
        Reporter:  strk                              |         Owner:  mhugent      
            Type:  bug                               |        Status:  reopened     
        Priority:  major: does not work as expected  |     Milestone:  Version 1.7.0
       Component:  Symbology                         |       Version:  Trunk        
      Resolution:                                    |      Keywords:  label        
Platform_version:                                    |      Platform:  Debian       
        Must_fix:  No                                |   Status_info:  0            
-----------------------------------------------------+----------------------

Comment(by strk):

 A slightly more elegant version:

 {{{

 diff --git a/src/core/pal/feature.cpp b/src/core/pal/feature.cpp
 index 6f657b1..5501434 100644
 --- a/src/core/pal/feature.cpp
 +++ b/src/core/pal/feature.cpp
 @@ -596,7 +596,7 @@ namespace pal
        {
          //std::cout << alpha*180/M_PI << std::endl;
          if ( flags & FLAG_MAP_ORIENTATION )
 -          reversed = ( alpha > M_PI / 2 || alpha < -M_PI / 2 );
 +          reversed = ( (ex == bx && ey < by ) || ( alpha > M_PI / 2 ||
 alpha < -M_PI / 2 ) );

          if (( !reversed && ( flags & FLAG_ABOVE_LINE ) ) || ( reversed &&
 ( flags & FLAG_BELOW_LINE ) ) )
            positions->push_back( new LabelPosition( i, bx + cos( beta )
 *distlabel , by + sin( beta ) *distlabel, xrm, yrm, alpha, cost, this,
 reversed ) ); // Line
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/3643#comment:8>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list