comparison OrthancStone/Sources/Viewport/WebAssemblyViewport.cpp @ 1575:e4a52cbbdd70

working on print
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Sep 2020 17:25:25 +0200
parents a80363b15235
children 92fca2b3ba3d
comparison
equal deleted inserted replaced
1574:fb5e620430ae 1575:e4a52cbbdd70
208 void WebAssemblyViewport::Invalidate() 208 void WebAssemblyViewport::Invalidate()
209 { 209 {
210 emscripten_request_animation_frame(OnRequestAnimationFrame, reinterpret_cast<void*>(this)); 210 emscripten_request_animation_frame(OnRequestAnimationFrame, reinterpret_cast<void*>(this));
211 } 211 }
212 212
213 void WebAssemblyViewport::FitForPrint()
214 {
215 if (compositor_.get() != NULL &&
216 controller_ /* should always be true */)
217 {
218 UpdateSize(*compositor_);
219 compositor_->FitContent(controller_->GetScene());
220 OnRequestAnimationFrame(0, reinterpret_cast<void*>(this));
221 }
222 }
223
213 void WebAssemblyViewport::AcquireCompositor(ICompositor* compositor /* takes ownership */) 224 void WebAssemblyViewport::AcquireCompositor(ICompositor* compositor /* takes ownership */)
214 { 225 {
215 if (compositor == NULL) 226 if (compositor == NULL)
216 { 227 {
217 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 228 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);