src/Tools/jEdit/src/jedit/TheoryView.scala
changeset 34392 a02d46bca7e4
parent 34391 7b5f44553aaf
child 34393 f0e1608a774f
equal deleted inserted replaced
34391:7b5f44553aaf 34392:a02d46bca7e4
   185     var savedColor = gfx.getColor
   185     var savedColor = gfx.getColor
   186     var e = prover.document.getNextCommandContaining(fromCurrent(start))
   186     var e = prover.document.getNextCommandContaining(fromCurrent(start))
   187 
   187 
   188     //Encolor Phase
   188     //Encolor Phase
   189     while (e != null && toCurrent(e.start) < end) {
   189     while (e != null && toCurrent(e.start) < end) {
   190       val begin = Math.max(start, toCurrent(e.start))
   190       val begin =  start max toCurrent(e.start)
   191       val finish = Math.min(end - 1, toCurrent(e.stop))
   191       val finish = end - 1 min  toCurrent(e.stop)
   192       encolor(gfx, y, fm.getHeight, begin, finish, chooseColor(e))
   192       encolor(gfx, y, fm.getHeight, begin, finish, chooseColor(e))
   193       // paint details of command
   193       // paint details of command
   194       var dy = 0
   194       var dy = 0
   195       for(status <- e.statuses){
   195       for(status <- e.statuses){
   196         dy += 1
   196         dy += 1
   197         val begin = Math.max(start, toCurrent(status.start + e.start))
   197         val begin = toCurrent(status.start + e.start)
   198         val finish = Math.min(end - 1, toCurrent(status.stop + e.start))
   198         val finish = toCurrent(status.stop + e.start)
   199         encolor(gfx, y + dy, fm.getHeight - dy, begin, finish, chooseColor(status.kind))
   199         if(finish > start && begin < end)
       
   200           encolor(gfx, y + dy, fm.getHeight - dy, begin max start, finish min end, chooseColor(status.kind))
   200       }
   201       }
   201       e = e.next
   202       e = e.next
   202     }
   203     }
   203 
   204 
   204     gfx.setColor(savedColor)
   205     gfx.setColor(savedColor)