Changeset 6297 for trunk


Ignore:
Timestamp:
May 1, 2016, 5:11:05 PM (8 years ago)
Author:
ldelgass
Message:

Clamp relative values to [0,1] in transfer function editor to prevent dragging
isovalues out of range.

File:
1 edited

Legend:

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

    r5640 r6297  
    4242    private method GetScreenPosition { name }
    4343    private method LeaveTick { name }
    44     private method SetRelativeValue  { name x }
    45     private method GetRelativeValue  { name }
     44    private method SetRelativeValue { name x }
     45    private method GetRelativeValue { name }
    4646    private method RemoveDuplicateMarkers {name x y}
    4747    private method SetScreenPosition { name }
     
    225225}
    226226
    227 itcl::body Rappture::TransferFunctionEditor::GetRelativeValue  { name } {
     227itcl::body Rappture::TransferFunctionEditor::GetRelativeValue { name } {
    228228    return $_values($name)
    229229}
    230230
    231 itcl::body Rappture::TransferFunctionEditor::SetRelativeValue  { name value } {
     231itcl::body Rappture::TransferFunctionEditor::SetRelativeValue { name value } {
     232    if {$value < 0.0} {
     233        set value 0.0
     234    } elseif {$value > 1.0} {
     235        set value 1.0
     236    }
    232237    set _values($name) $value
    233238    set x [GetScreenPosition $name]
Note: See TracChangeset for help on using the changeset viewer.