Hi,
currently its a little hard to see where a fics offer is located in the offer graph without reading the offer text. The patch in the attachment introduces more guidelines and labels so that s.o. can find an offer more quickly. Jens
From 5e3b8e9eff9efdab195c6e38c30913e83569ce13 Mon Sep 17 00:00:00 2001 From: Jens Hoffmann <xmc...@gmail.com> Date: Wed, 18 Nov 2015 19:58:39 +0100 Subject: [PATCH 1/2] Fics offers: draw guide lines and labels * draw horizontal lines in steps of 100 (ELO) * draw vertical lines in steps of 2m, 5m, 10m, 15m, 30m, 60m --- tcl/tools/fics.tcl | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/tcl/tools/fics.tcl b/tcl/tools/fics.tcl index e737a84..876bd1c 100644 --- a/tcl/tools/fics.tcl +++ b/tcl/tools/fics.tcl @@ -19,6 +19,7 @@ namespace eval fics { set width 300 set height 300 set off 20 + set off_small 2 set graphon 0 set timeseal_pid 0 font create font_offers -family courier -size 12 -weight bold @@ -1130,7 +1131,8 @@ namespace eval fics { ################################################################################ proc displayOffers { } { global ::fics::width ::fics::height ::fics::off \ - ::fics::offers_minelo ::fics::offers_maxelo ::fics::offers_mintime ::fics::offers_maxtime + ::fics::offers_minelo ::fics::offers_maxelo ::fics::offers_mintime ::fics::offers_maxtime \ + ::fics::off_small after cancel ::fics::updateOffers set w .fics.f.top.foffers @@ -1140,17 +1142,28 @@ namespace eval fics { #first erase the canvas foreach id [ $w.c find all] { $w.c delete $id } - # draw scales - $w.c create line $off [expr $height - $off ] $width [expr $height - $off] -fill blue - $w.c create line $off 0 $off [expr $height - $off] -fill blue - $w.c create text 1 1 -fill black -anchor nw -text ELO - $w.c create text [expr $width - 1 ] [expr $height - 1 ] -fill black -anchor se -text [tr Time] + # Draw horizontal lines + set y_unit [expr $height / 31.0] + for {set i 0} {$i < 31} {incr i} { + set y [expr $height - $i * $y_unit] + $w.c create line 0 $y $width $y -fill "light gray" + } - # draw time markers at 5', 15' - set x [ expr $off + 5 * ($width - $off) / ($offers_maxtime - $offers_mintime)] - $w.c create line $x 0 $x [expr $height - $off] -fill red - set x [ expr $off + 15 * ($width - $off) / ($offers_maxtime - $offers_mintime)] - $w.c create line $x 0 $x [expr $height - $off] -fill red + # Draw horizontal tics and labels + foreach elo [list 5 10 15 20 25 30] { + set y [expr $height - $elo * $y_unit] + $w.c create line [expr $width - $off] $y $width $y -fill black + $w.c create text [expr $width - $off_small] $y -fill black -anchor se -text [expr $elo * 100] + } + + # Draw vertical lines, tics and labels + set x_unit [expr ($width - 2 * $off) / 60.0] + foreach t [list 2 5 10 15 30 60] { + set x [expr $t * $x_unit] + $w.c create line $x $height $x 0 -fill "light gray" + $w.c create line $x $height $x [expr $height - $off] -fill black + $w.c create text [expr $x + $off_small] $height -fill black -anchor sw -text "${t}m" + } foreach g $::fics::soughtlist { array set l $g @@ -1170,8 +1183,9 @@ namespace eval fics { set fillcolor gray } - set x [ expr $off + $tt * ($width - $off) / ($offers_maxtime - $offers_mintime)] - set y [ expr $height - $off - ( $l(elo) - $offers_minelo ) * ($height - $off) / ($offers_maxelo - $offers_minelo)] + set x [expr $tt * $x_unit] + set y [expr $height - ($l(elo) / 100.0) * $y_unit] + if { $l(rated) == "rated" } { set object "oval" } else { -- 2.1.4
From 74186a11fce31e554e7b326ff1ade6525a7c34fe Mon Sep 17 00:00:00 2001 From: Jens Hoffmann <xmc...@gmail.com> Date: Wed, 18 Nov 2015 20:03:47 +0100 Subject: [PATCH 2/2] Fics: Remove trailing whitespace --- tcl/tools/fics.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcl/tools/fics.tcl b/tcl/tools/fics.tcl index 876bd1c..5bc4c30 100644 --- a/tcl/tools/fics.tcl +++ b/tcl/tools/fics.tcl @@ -1306,10 +1306,10 @@ namespace eval fics { if { $::fics::playing == 1 } { return 1 } - if { $::fics::premoveEnabled && $::fics::playing == -1 } { + if { $::fics::premoveEnabled && $::fics::playing == -1 } { .main.board.bd delete mark set ::fics::premoveSq1 -1 - return 1 + return 1 } return 0 } -- 2.1.4
------------------------------------------------------------------------------
_______________________________________________ Scid-users mailing list Scid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scid-users