Fix right-edge spillover of Seek-Graph dots in WinBoard
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 10 Feb 2010 09:50:11 +0000 (10:50 +0100)
committerArun Persaud <arun@nubati.net>
Sun, 21 Feb 2010 00:35:01 +0000 (16:35 -0800)
Rescale the X-axis to allow margin for dot size and color offset.

backend.c

index 9636abc..f0811fd 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -2089,7 +2089,7 @@ PlotSeekAd(int i)
        if(r > maxRating) r = maxRating;
        if(tc < 1.) tc = 1.;
        if(tc > 95.) tc = 95.;
-       x = (w-hMargin)* log(tc)/log(100.) + hMargin;
+       x = (w-hMargin-squareSize/8-7)* log(tc)/log(95.) + hMargin;
        y = ((double)r - minRating)/(maxRating - minRating)
            * (h-vMargin-squareSize/8-1) + vMargin;
        if(ratingList[i] < 0) y = vMargin + squareSize/4;
@@ -2201,7 +2201,7 @@ DrawSeekGraph()
     }
     DrawSeekText("unrated", hMargin+squareSize/8+7, h-1-vMargin-squareSize/4);
     for(i=1; i<100; i+=(i<10?1:5)) {
-       int xx = (w-hMargin)* log((double)i)/log(100.) + hMargin;
+       int xx = (w-hMargin-squareSize/8-7)* log((double)i)/log(95.) + hMargin;
        DrawSeekAxis(xx, h-1-vMargin, xx, h-6-vMargin-3*(i%10==0)); // TC ticks
        if(i<=5 || (i>40 ? i%20 : i%10) == 0) {
            char buf[MSG_SIZ];