ソースを参照

Fix a potential crash when initializing the map for meshes with holes (#1263)

* * Fix a potential crash when initializing the map for meshes with holes
* Fix a minor conversion warning

* * Fix a potential crash when initializing the map for meshes with holes
* Fix a minor conversion warning
martin-marinov77 6 年 前
コミット
4e5dfe1aae
1 ファイル変更2 行追加2 行削除
  1. 2 2
      tutorial/710_SCAF/main.cpp

+ 2 - 2
tutorial/710_SCAF/main.cpp

@@ -21,7 +21,7 @@ igl::Timer timer;
 igl::SCAFData scaf_data;
 
 bool show_uv = false;
-float uv_scale = 0.2;
+float uv_scale = 0.2f;
 
 bool key_down(igl::opengl::glfw::Viewer& viewer, unsigned char key, int modifier)
 {
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
     Eigen::MatrixXi F_filled;
     igl::topological_hole_fill(F, bnd, all_bnds, F_filled);
     igl::harmonic(F_filled, bnd, bnd_uv ,1, uv_init);
-    uv_init = uv_init.topRows(V.rows());
+    uv_init.conservativeResize(V.rows(), 2);
   }
 
   Eigen::VectorXi b; Eigen::MatrixXd bc;