Mercurial > hg > orthanc-stone
diff 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 |
line wrap: on
line diff
--- a/OrthancStone/Sources/Viewport/WebAssemblyViewport.cpp Mon Sep 21 18:29:53 2020 +0200 +++ b/OrthancStone/Sources/Viewport/WebAssemblyViewport.cpp Wed Sep 23 17:25:25 2020 +0200 @@ -210,6 +210,17 @@ emscripten_request_animation_frame(OnRequestAnimationFrame, reinterpret_cast<void*>(this)); } + void WebAssemblyViewport::FitForPrint() + { + if (compositor_.get() != NULL && + controller_ /* should always be true */) + { + UpdateSize(*compositor_); + compositor_->FitContent(controller_->GetScene()); + OnRequestAnimationFrame(0, reinterpret_cast<void*>(this)); + } + } + void WebAssemblyViewport::AcquireCompositor(ICompositor* compositor /* takes ownership */) { if (compositor == NULL)