X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=evalgraph.c;h=f386df34d87ed8bf730db0224a1f9a5fb8ff06bd;hb=bf07cc0c5232c7cd486fab118defa0815ff89183;hp=1380276dce7a164a644e1ab9f5199db322d67dc9;hpb=2eff6e6600cef28c3b915205dbd75e63b3cd641e;p=xboard.git diff --git a/evalgraph.c b/evalgraph.c index 1380276..f386df3 100644 --- a/evalgraph.c +++ b/evalgraph.c @@ -109,8 +109,10 @@ static int GetValueY( int value ) { if( value < -range*700 ) value = -range*700; if( value > +range*700 ) value = +range*700; - - return (nHeightPB / 2) - (int)(value * (nHeightPB - 2*MarginH) / (1400.*range)); + if(value > 100*range) value += appData.zoom * 100 - 100*range; else + if(value < -100*range) value -= appData.zoom * 100 - 100*range; else + value *= appData.zoom; + return (nHeightPB / 2) - (int)(value * (nHeightPB - 2*MarginH) / ((1200. + 200.*appData.zoom)*range)); } // the brush selection is made part of the DrawLine, by passing a style argument @@ -136,18 +138,14 @@ static void DrawAxisSegmentHoriz( int value, Boolean drawValue ) // the initial brush selection is useless? BkMode needed for dotted line and text static void DrawAxis() { - int cy = nHeightPB / 2; + int cy = nHeightPB / 2, space = nHeightPB/(6 + appData.zoom); -// SelectObject( hdcPB, GetStockObject(NULL_BRUSH) ); - -// SetBkMode( hdcPB, TRANSPARENT ); - DrawAxisSegmentHoriz( +5, TRUE ); - DrawAxisSegmentHoriz( +3, FALSE ); - DrawAxisSegmentHoriz( +1, FALSE ); + DrawAxisSegmentHoriz( +3, space >= 20 ); + DrawAxisSegmentHoriz( +1, space >= 20 && space*appData.zoom >= 40 ); DrawAxisSegmentHoriz( 0, TRUE ); - DrawAxisSegmentHoriz( -1, FALSE ); - DrawAxisSegmentHoriz( -3, FALSE ); + DrawAxisSegmentHoriz( -1, space >= 20 && space*appData.zoom >= 40 ); + DrawAxisSegmentHoriz( -3, space >= 20 ); DrawAxisSegmentHoriz( -5, TRUE ); DrawLine( MarginX + MarginW, cy, nWidthPB - MarginW, cy, PEN_BLACK ); // x-axis @@ -159,7 +157,7 @@ static void DrawHistogram( int x, int y, int width, int value, int side ) { int left, top, right, bottom; - if( value > -25 && value < +25 ) return; + if( value > -appData.evalThreshold*range && value < +appData.evalThreshold*range ) return; left = x; right = left + width + 1;