changeset 822:76e8224bc300

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 29 May 2019 14:19:06 +0200
parents 5c7b08bf84af
children 467d58a59718
files Samples/WebAssembly/BasicMPR.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Samples/WebAssembly/BasicMPR.cpp	Wed May 29 13:42:34 2019 +0200
+++ b/Samples/WebAssembly/BasicMPR.cpp	Wed May 29 14:19:06 2019 +0200
@@ -91,6 +91,11 @@
       compositor_.Refresh();
     }
 
+    void FitContent()
+    {
+      GetScene().FitContent(context_.GetCanvasWidth(), context_.GetCanvasHeight());
+    }
+
     const std::string& GetCanvasIdentifier() const
     {
       return context_.GetCanvasIdentifier();
@@ -303,6 +308,10 @@
       {
         planes_[z] = geometry.GetProjectionSlice(projection_, z);
       }
+
+      Refresh();
+
+      viewport_.FitContent();
     }
     
   public:
@@ -350,6 +359,7 @@
           currentPlane_ < planes_.size())
       {
         source_->Update(planes_[currentPlane_]);
+        viewport_.Refresh();
       }
     }
   };