Fix for Bug IPAL11592:

There is incorrect behavior of "Origin & Size" entry fields in "Preferences".
This commit is contained in:
enk 2006-02-17 08:53:33 +00:00
parent 5fc163de50
commit d1f28a061f

View File

@ -3001,6 +3001,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
{ {
if( sect=="SMESH" ){ if( sect=="SMESH" ){
float sbX1,sbY1,sbW,sbH; float sbX1,sbY1,sbW,sbH;
float aTol = 1.00000009999999;
std::string aWarning; std::string aWarning;
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this); SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
if( name=="selection_object_color" || name=="selection_element_color" || if( name=="selection_object_color" || name=="selection_element_color" ||
@ -3010,7 +3011,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){ else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){
sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1); sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1);
sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW); sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW);
if(sbX1+sbW > 1.0){ if(sbX1+sbW > aTol){
aWarning = "Origin and Size Vertical: X+Width > 1\n"; aWarning = "Origin and Size Vertical: X+Width > 1\n";
sbX1=0.01; sbX1=0.01;
sbW=0.05; sbW=0.05;
@ -3021,7 +3022,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){ else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){
sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1); sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1);
sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH); sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH);
if(sbY1+sbH > 1.0){ if(sbY1+sbH > aTol){
aWarning = "Origin and Size Vertical: Y+Height > 1\n"; aWarning = "Origin and Size Vertical: Y+Height > 1\n";
sbY1=0.01; sbY1=0.01;
sbH=0.5; sbH=0.5;
@ -3032,7 +3033,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
else if(name == QString("scalar_bar_horizontal_x") || name == QString("scalar_bar_horizontal_width")){ else if(name == QString("scalar_bar_horizontal_x") || name == QString("scalar_bar_horizontal_width")){
sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1); sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1);
sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW); sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW);
if(sbX1+sbW > 1.0){ if(sbX1+sbW > aTol){
aWarning = "Origin and Size Horizontal: X+Width > 1\n"; aWarning = "Origin and Size Horizontal: X+Width > 1\n";
sbX1=0.2; sbX1=0.2;
sbW=0.6; sbW=0.6;
@ -3043,7 +3044,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
else if(name == QString("scalar_bar_horizontal_y") || name == QString("scalar_bar_horizontal_height")){ else if(name == QString("scalar_bar_horizontal_y") || name == QString("scalar_bar_horizontal_height")){
sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1); sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1);
sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH); sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH);
if(sbY1+sbH > 1.0){ if(sbY1+sbH > aTol){
aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
sbY1=0.01; sbY1=0.01;
sbH=0.12; sbH=0.12;