Ignore:
Timestamp:
Jun 26, 2009, 1:16:20 PM (15 years ago)
Author:
gah
Message:

fixed bug when displaying ALL in molvisviewer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/heightmapviewer.tcl

    r1496 r1531  
    2424option add *HeightmapViewer.plotForeground white widgetDefault
    2525option add *HeightmapViewer.plotOutline white widgetDefault
    26 option add *HeightmapViewer.font \
    27     -*-helvetica-medium-r-normal-*-12-* widgetDefault
     26option add *HeightmapViewer.font -*-helvetica-medium-r-normal-*-12-* widgetDefault
    2827
    2928# must use this name -- plugs into Rappture::resources::load
     
    660659        if {"" == [$c find withtag transfunc]} {
    661660            $c create image 0 [expr $lineht] -anchor ne \
    662                  -image $_image(legend) -tags transfunc
     661                 -image $_image(legend) -tags transfunc 
    663662            $c create text 10 [expr {$h-8}] -anchor se \
    664                  -fill $itk_option(-plotforeground) -tags vmin
     663                -fill $itk_option(-plotforeground) -tags vmin \
     664                -font "Arial 8 bold"
    665665            $c create text [expr {$w-10}] [expr {$h-8}] -anchor ne \
    666                  -fill $itk_option(-plotforeground) -tags vmax
     666                 -fill $itk_option(-plotforeground) -tags vmax \
     667                -font "Arial 8 bold"
    667668        }
    668669        $c coords transfunc [expr $w - 5] [expr $lineht]
     
    10371038        set style(-color) "white:yellow:green:cyan:blue:magenta"
    10381039    }
    1039     set clist [split $style(-color) :]
    1040     set color white
    1041     set cmap "0.0 [Color2RGB $color] "
    1042     set range [expr $_limits(vmax) - $_limits(vmin)]
    1043     for {set i 0} {$i < [llength $clist]} {incr i} {
    1044         set xval [expr {double($i+1)/([llength $clist]+1)}]
    1045         set color [lindex $clist $i]
    1046         append cmap "$xval [Color2RGB $color] "
    1047     }
    1048     append cmap "1.0 [Color2RGB $color] "
    1049 
     1040    if { [info exists style(-nonuniformcolors)] } {
     1041        foreach { value color } $style(-nonuniformcolors) {
     1042            append cmap "$value [Color2RGB $color] "
     1043        }
     1044    } else {
     1045        set clist [split $style(-color) :]
     1046        set cmap "0.0 [Color2RGB white] "
     1047        for {set i 0} {$i < [llength $clist]} {incr i} {
     1048            set x [expr {double($i+1)/([llength $clist]+1)}]
     1049            set color [lindex $clist $i]
     1050            append cmap "$x [Color2RGB $color] "
     1051        }
     1052        append cmap "1.0 [Color2RGB $color]"
     1053    }
    10501054    set opacity $style(-opacity)
    10511055    set levels $style(-levels)
Note: See TracChangeset for help on using the changeset viewer.