X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=dedf3338071f126f49b650c700a4c79c4f53d395;hb=475d3b4e733b515cb06dbe46921f63cb15399ff4;hp=caa8e19e5fe50edd4982e2817e20aeea9e3e9644;hpb=394d2d698de4f7f24853af499fdfe9a339d7a832;p=xboard.git diff --git a/backend.c b/backend.c index caa8e19..dedf333 100644 --- a/backend.c +++ b/backend.c @@ -2071,6 +2071,7 @@ Boolean seekGraphUp; char *seekAdList[MAX_SEEK_ADS]; int ratingList[MAX_SEEK_ADS], xList[MAX_SEEK_ADS], yList[MAX_SEEK_ADS], seekNrList[MAX_SEEK_ADS], zList[MAX_SEEK_ADS]; float tcList[MAX_SEEK_ADS]; +char colorList[MAX_SEEK_ADS]; int nrOfSeekAds = 0; int minRating = 1010, maxRating = 2800; int hMargin = 10, vMargin = 20, h, w; @@ -2088,14 +2089,14 @@ PlotSeekAd(int i) if(tc > 95.) tc = 95.; x = (w-hMargin)* log(tc)/log(100.) + hMargin; y = ((double)r - minRating)/(maxRating - minRating) - * (h-vMargin-squareSize/8) + vMargin; + * (h-vMargin-squareSize/8-1) + vMargin; if(ratingList[i] < 0) y = vMargin + squareSize/4; if(strstr(seekAdList[i], " u ")) color = 1; if(!strstr(seekAdList[i], "lightning") && // for now all wilds same color !strstr(seekAdList[i], "bullet") && !strstr(seekAdList[i], "blitz") && !strstr(seekAdList[i], "standard") ) color = 2; - DrawSeekDot(xList[i]=x+3*color, yList[i]=h-1-y, color); + DrawSeekDot(xList[i]=x+3*color, yList[i]=h-1-y, colorList[i]=color); } void @@ -2121,6 +2122,40 @@ AddAd(char *handle, char *rating, int base, int inc, char rated, char *type, in } } +void +EraseSeekDot(int i) +{ + int x = xList[i], y = yList[i], d=squareSize/4, k; + DrawSeekBackground(x-squareSize/8, y-squareSize/8, x+squareSize/8+1, y+squareSize/8+1); + if(x < hMargin+d) DrawSeekAxis(hMargin, y-squareSize/8, hMargin, y+squareSize/8+1); + // now replot every dot that overlapped + for(k=0; k x-d && yy <= y+d && yy > y-d) + DrawSeekDot(xx, yy, colorList[k]); + } +} + +void +RemoveSeekAd(int nr) +{ + int i; + for(i=0; i=minRating && i