|
@@ -168,7 +168,7 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
F32 Scale = F32( getExtent().y ) / F32( mGraphMax[ k ] * 1.05 );
|
|
F32 Scale = F32( getExtent().y ) / F32( mGraphMax[ k ] * 1.05 );
|
|
|
|
|
|
const S32 numSamples = mGraphData[ k ].size();
|
|
const S32 numSamples = mGraphData[ k ].size();
|
|
-
|
|
|
|
|
|
+ F32 graphOffset;
|
|
switch( mGraphType[ k ] )
|
|
switch( mGraphType[ k ] )
|
|
{
|
|
{
|
|
case Bar:
|
|
case Bar:
|
|
@@ -180,21 +180,21 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
PrimBuild::begin( GFXTriangleStrip, 4 );
|
|
PrimBuild::begin( GFXTriangleStrip, 4 );
|
|
PrimBuild::color( mGraphColor[ k ] );
|
|
PrimBuild::color( mGraphColor[ k ] );
|
|
|
|
|
|
- F32 offset = F32( getExtent().x ) / F32( MaxDataPoints ) * F32( sample + 1 );
|
|
|
|
|
|
+ graphOffset = F32( getExtent().x ) / F32( MaxDataPoints ) * F32( sample + 1 );
|
|
|
|
|
|
PrimBuild::vertex2f( globalPos.x + prevOffset,
|
|
PrimBuild::vertex2f( globalPos.x + prevOffset,
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
|
|
|
|
- PrimBuild::vertex2f( globalPos.x + offset,
|
|
|
|
|
|
+ PrimBuild::vertex2f( globalPos.x + graphOffset,
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
|
|
|
|
- PrimBuild::vertex2f( globalPos.x + offset,
|
|
|
|
|
|
+ PrimBuild::vertex2f( globalPos.x + graphOffset,
|
|
midPointY );
|
|
midPointY );
|
|
|
|
|
|
PrimBuild::vertex2f( globalPos.x + prevOffset,
|
|
PrimBuild::vertex2f( globalPos.x + prevOffset,
|
|
midPointY );
|
|
midPointY );
|
|
|
|
|
|
- prevOffset = offset;
|
|
|
|
|
|
+ prevOffset = graphOffset;
|
|
|
|
|
|
PrimBuild::end();
|
|
PrimBuild::end();
|
|
}
|
|
}
|
|
@@ -209,12 +209,12 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
|
|
|
|
for( S32 sample = 0; sample < numSamples; ++ sample )
|
|
for( S32 sample = 0; sample < numSamples; ++ sample )
|
|
{
|
|
{
|
|
- F32 offset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
|
|
|
|
|
+ graphOffset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
|
|
|
|
|
- PrimBuild::vertex2f( globalPos.x + offset,
|
|
|
|
|
|
+ PrimBuild::vertex2f( globalPos.x + graphOffset,
|
|
midPointY );
|
|
midPointY );
|
|
|
|
|
|
- PrimBuild::vertex2f( globalPos.x + offset,
|
|
|
|
|
|
+ PrimBuild::vertex2f( globalPos.x + graphOffset,
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
}
|
|
}
|
|
|
|
|
|
@@ -234,9 +234,9 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
|
|
|
|
for( S32 sample = 0; sample < numSamples; ++ sample )
|
|
for( S32 sample = 0; sample < numSamples; ++ sample )
|
|
{
|
|
{
|
|
- F32 offset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
|
|
|
|
|
+ graphOffset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
|
|
|
|
|
- PrimBuild::vertex2f( globalPos.x + offset,
|
|
|
|
|
|
+ PrimBuild::vertex2f( globalPos.x + graphOffset,
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
midPointY - ( getDatum( k, sample ) * Scale ) );
|
|
}
|
|
}
|
|
|
|
|