Also, here is the model to demonstrate Tk's behaviour. Green rectangles are actual coords provided, colored rectangles show how Tk draws them:
-----
canvas .c -bg white -highlightthickness 0
grid .c
for {set f 0} {$f<500} {incr f 20} {
.c create line $f 0 $f 2000 -width 0 -fill grey
.c create line 0 $f 2000 $f -width 0 -fill grey
}

set x1 20
set x2 40
set y2 200
for {set f 1} {$f<20} {incr f} {
set y1 [expr {$y2-5*$f}]
if {($y2-$y1)<20} {
set a [.c create rectangle $x1 $y2 $x2 [expr {$y2+20}] -fill red -width 0]
} else {
set a [.c create rectangle $x1 [expr {round($y1/20.0)*20}] $x2 $y2 -fill lightblue -width 0]
}
.c lower $a
.c create rectangle $x1 $y1 $x2 $y2 -outline darkgreen
incr x1 20
incr x2 20
}
-----