Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 128760 | Differences between
and this patch

Collapse All | Expand All

(-)freetype-2.1.10.built/src/base/ftoutln.c (-7 / +35 lines)
Lines 778-784 Link Here
778
          contour++, first = last + 1 )
778
          contour++, first = last + 1 )
779
    {
779
    {
780
      FT_Vector*  point;
780
      FT_Vector*  point;
781
781
      FT_Int      on_curve;
782
      FT_Int      on_curve_count = 0;
783
      FT_Pos      tmp_xmin       = 32768L;
784
      FT_Vector*  tmp_xmin_point = NULL;
782
785
783
      last = outline->points + *contour;
786
      last = outline->points + *contour;
784
787
Lines 786-801 Link Here
786
      if ( last < first + 2 )
789
      if ( last < first + 2 )
787
        continue;
790
        continue;
788
791
789
      for ( point = first; point <= last; point++ )
792
      for ( point = first; point <= last; ++point )
790
      {
793
      {
791
        if ( point->x < xmin )
794
        /* Count on curve points, if there are less than 3 on curve points,
795
           then just bypass this contour.
796
         */
797
        on_curve = (outline->tags [point - outline->points] & 1);
798
        on_curve_count += on_curve;
799
800
        if ( point->x < tmp_xmin  && on_curve)
792
        {
801
        {
793
          xmin       = point->x;
802
          tmp_xmin       = point->x;
794
          xmin_point = point;
803
          tmp_xmin_point = point;
795
          xmin_first = first;
796
          xmin_last  = last;
797
        }
804
        }
798
      }
805
      }
806
807
      if (on_curve_count > 2 && tmp_xmin < xmin)
808
      {
809
        xmin       = tmp_xmin;
810
        xmin_point = tmp_xmin_point;
811
        xmin_first = first;
812
        xmin_last  = last;
813
      }
799
    }
814
    }
800
815
801
    if ( !xmin_point )
816
    if ( !xmin_point )
Lines 804-809 Link Here
804
    prev = ( xmin_point == xmin_first ) ? xmin_last : xmin_point - 1;
819
    prev = ( xmin_point == xmin_first ) ? xmin_last : xmin_point - 1;
805
    next = ( xmin_point == xmin_last ) ? xmin_first : xmin_point + 1;
820
    next = ( xmin_point == xmin_last ) ? xmin_first : xmin_point + 1;
806
821
822
    /* Skip off curve points */
823
    while ((outline->tags [prev - outline->points] & 1) == 0)
824
    {
825
      if (prev == xmin_first) prev = xmin_last;
826
      else --prev;
827
    }
828
829
    while ((outline->tags [next - outline->points] & 1) == 0)
830
    {
831
      if (next == xmin_last) next = xmin_first;
832
      else ++next;
833
    }
834
807
    if ( FT_Atan2( prev->x - xmin_point->x, prev->y - xmin_point->y ) >
835
    if ( FT_Atan2( prev->x - xmin_point->x, prev->y - xmin_point->y ) >
808
         FT_Atan2( next->x - xmin_point->x, next->y - xmin_point->y ) )
836
         FT_Atan2( next->x - xmin_point->x, next->y - xmin_point->y ) )
809
      return FT_ORIENTATION_POSTSCRIPT;
837
      return FT_ORIENTATION_POSTSCRIPT;

Return to bug 128760