From 47fa3e28b9335ccf54bbd9ba7b75af92a81298f3 Mon Sep 17 00:00:00 2001
From: Jean-Francois Remacle <jean-francois.remacle@uclouvain.be>
Date: Tue, 18 Mar 2008 11:41:08 +0000
Subject: [PATCH] *** empty log message ***

---
 Box/Box.cpp    | 4 ++--
 Fltk/Main.cpp  | 7 +++----
 Mesh/Field.cpp | 4 ++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Box/Box.cpp b/Box/Box.cpp
index 4c6789f10d..24265bf67c 100644
--- a/Box/Box.cpp
+++ b/Box/Box.cpp
@@ -1,4 +1,4 @@
-// $Id: Box.cpp,v 1.46 2008-03-18 11:33:04 remacle Exp $
+// $Id: Box.cpp,v 1.47 2008-03-18 11:41:08 remacle Exp $
 //
 // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 //
@@ -88,7 +88,7 @@ int GMSHBOX(int argc, char *argv[])
     if(CTX.bgm_filename) {
       MergeFile(CTX.bgm_filename);
       if(PView::list.size()){
-				GModel::current()->fields.set_background_mesh(PView::list.back()->getNum());
+				GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()-1);
       }
       else{
         fprintf(stderr, ERROR_STR "Invalid background mesh (no view)\n");
diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp
index df3138cc2f..e7682654cb 100644
--- a/Fltk/Main.cpp
+++ b/Fltk/Main.cpp
@@ -1,4 +1,4 @@
-// $Id: Main.cpp,v 1.122 2008-03-18 11:33:04 remacle Exp $
+// $Id: Main.cpp,v 1.123 2008-03-18 11:41:08 remacle Exp $
 //
 // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 //
@@ -88,8 +88,7 @@ int main(int argc, char *argv[])
       if(CTX.bgm_filename) {
         MergeFile(CTX.bgm_filename);
         if(PView::list.size()){
-					printf("iii = %i\n",PView::list.back()->getNum());
-					GModel::current()->fields.set_background_mesh(PView::list.back()->getNum());
+					GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()-1);
         }
         else
           Msg(GERROR, "Invalid background mesh (no view)");
@@ -169,7 +168,7 @@ int main(int argc, char *argv[])
   if(CTX.bgm_filename) {
     MergeFile(CTX.bgm_filename);
     if(PView::list.size())
-			GModel::current()->fields.set_background_mesh(PView::list.back()->getNum());
+			GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()-1);
     else
       Msg(GERROR, "Invalid background mesh (no view)");
   }
diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp
index cb83af0d04..1c2ac8f6d0 100644
--- a/Mesh/Field.cpp
+++ b/Mesh/Field.cpp
@@ -1,4 +1,4 @@
-// $Id: Field.cpp,v 1.17 2008-03-18 11:33:04 remacle Exp $
+// $Id: Field.cpp,v 1.18 2008-03-18 11:41:08 remacle Exp $
 //
 // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 //
@@ -892,7 +892,7 @@ void Field::put_on_view(PView *view,int comp)
 void FieldManager::set_background_mesh(int iView){
 	int id=new_id();
 	Field *f=new_field(id,"PostView");
-	f->options["IView"]->numerical_value(iView-1);
+	f->options["IView"]->numerical_value(iView);
 	(*this)[id]=f;
 	background_field=id;
 }
-- 
GitLab