From: jfa Date: Thu, 14 Jul 2005 06:39:19 +0000 (+0000) Subject: Merge with branch V2_2_0_VISU_improvement : small debug X-Git-Tag: V3_0_1~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7bf347a62fce16c2c26ba13403c35aff6496c866;p=modules%2Fvisu.git Merge with branch V2_2_0_VISU_improvement : small debug --- diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 67dbc980..19ff935d 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -322,10 +322,14 @@ void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos) storePrsParams(); myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos); restorePrsParams(); - if (isRelativePos) // absolute -> relative - pos = (pos - minPos) / (maxPos - minPos); - else // relative -> absolute - pos = minPos * (1. - pos) + maxPos * pos; + if (-1e-7 < (maxPos - minPos) && (maxPos - minPos) < 1e-7) { + pos = 0; + } else { + if (isRelativePos) // absolute -> relative + pos = (pos - minPos) / (maxPos - minPos); + else // relative -> absolute + pos = minPos * (1. - pos) + maxPos * pos; + } } if (isRelativePos) { minPos = 0.;