From f9122bf9eccb7aa1b5ffc97c692a69b5e0f4bce0 Mon Sep 17 00:00:00 2001 From: enk Date: Fri, 17 Feb 2006 08:52:53 +0000 Subject: [PATCH] Fix for Bug IPAL11592: There is incorrect behavior of "Origin & Size" entry fields in "Preferences". --- src/VISUGUI/VisuGUI.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 7bc17315..f6ba5bfb 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2948,11 +2948,12 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) if (b == QString("scalar_bar_orientation")) return; SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); float sbX1,sbY1,sbW,sbH; + float aTol = 1.00000009999999; std::string aWarning; if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){ sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", sbX1); sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", sbW); - if(sbX1+sbW > 1.0){ + if(sbX1+sbW > aTol){ aWarning = "Origin and Size Vertical: X+Width > 1\n"; sbX1=0.01; sbW=0.05; @@ -2963,7 +2964,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){ sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1); sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH); - if(sbY1+sbH > 1.0){ + if(sbY1+sbH > aTol){ aWarning = "Origin and Size Vertical: Y+Height > 1\n"; sbY1=0.01; sbH=0.5; @@ -2974,7 +2975,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){ sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1); sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW); - if(sbX1+sbW > 1.0){ + if(sbX1+sbW > aTol){ aWarning = "Origin and Size Horizontal: X+Width > 1\n"; sbX1=0.2; sbW=0.6; @@ -2985,7 +2986,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){ sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1); sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH); - if(sbY1+sbH > 1.0){ + if(sbY1+sbH > aTol){ aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; sbY1=0.01; sbH=0.12; -- 2.39.2