From 7bf347a62fce16c2c26ba13403c35aff6496c866 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 14 Jul 2005 06:39:19 +0000 Subject: [PATCH] Merge with branch V2_2_0_VISU_improvement : small debug --- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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.; -- 2.39.2