Skip to content

Commit

Permalink
- Summary: Refactor code. (T63778)
Browse files Browse the repository at this point in the history
- Bugzilla Bug(s) Resolved: 

- Description: Refactor code. (T63778)
  • Loading branch information
Frank Ding authored and Frank Ding committed Sep 2, 2013
1 parent 2ed749d commit 10679e8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
Expand Up @@ -1508,7 +1508,7 @@ protected Element createShape( Shape shape )
StringBuffer pathStr = new StringBuffer( );
while ( !pathIter.isDone( ) )
{
double[] points = new double[6];
float[] points = new float[6];
int TYPE = pathIter.currentSegment( points );
switch ( TYPE )
{
Expand Down Expand Up @@ -1962,4 +1962,27 @@ static String toString( double[] v, int length, char separator )
}
return buffer.toString( );
}

static String toString( float[] v, int length, char separator )
{
if ( v.length == 0 )
{
return ""; //$NON-NLS-1$
}
if ( v.length == 1 )
{
return toString( v[0] );
}
if ( length > v.length )
{
length = v.length;
}
StringBuffer buffer = new StringBuffer( toString( v[0] ) );
for ( int i = 1; i < length; i++ )
{
buffer.append( separator );
buffer.append( toString( v[i] ) );
}
return buffer.toString( );
}
}
Expand Up @@ -740,7 +740,7 @@ private List<TextRenderEvent> renderVerticalAxisTickLabels( ComputationContext c
computation.handlePreEachTick( i );

double y = da.getCoordinate( i );
boolean bSkipTickLine = ChartUtil.mathEqual( yLast, y );
boolean bSkipTickLine = ( Math.abs( yLast - y ) < 1 );
if ( !bSkipTickLine )
{
yLast = y;
Expand Down Expand Up @@ -1039,7 +1039,7 @@ private List<TextRenderEvent> renderHorizontalAxisTickLabels( ComputationContex

double x = da.getCoordinate( i );

boolean bSkipTickLine = ChartUtil.mathEqual( x, xLast );
boolean bSkipTickLine = ( Math.abs( x - xLast ) < 1 );
if ( !bSkipTickLine )
{
xLast = x;
Expand Down

0 comments on commit 10679e8

Please sign in to comment.