quantile_v2_fix.diff

Jeremy Palmer, 2010-08-22 05:00 PM

Download (923 Bytes)

View differences:

src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp (revision 692)
301 301
  // (indices of X: 1...n)
302 302

  
303 303
  int n = values.count();
304
  double q, a, aa, r, Xq;
305
  for ( int i = 0; i < ( classes - 1 ); i++ )
304
  double Xq = n > 0 ? values[0] : 0.0;
305

  
306
  for ( int i = 1; i < classes; i++ )
306 307
  {
307
    q = ( i + 1 ) / ( double ) classes;
308
    a = q * n;
309
    aa = ( int )( q * n );
308
    if( n > 1 )
309
    {
310
      double q = i  / ( double ) classes;
311
      double a = q * (n-1);
312
      int aa = ( int )( a );
310 313

  
311
    r = a - aa;
312
    Xq = ( 1 - r ) * values[aa] + r * values[aa+1];
313

  
314
      double r = a - aa;
315
      Xq = ( 1 - r ) * values[aa] + r * values[aa+1];
316
    }
314 317
    breaks.append( Xq );
315 318
  }
316 319