comparison Applications/Samples/Common/RtViewerView.cpp @ 1594:74ed691f9c64

fix initial rendering of MPR sample
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 26 Oct 2020 15:52:11 +0100
parents 32e0c007789d
children 52b8b96cb55f
comparison
equal deleted inserted replaced
1593:b782f78aed42 1594:74ed691f9c64
247 } 247 }
248 248
249 void RtViewerView::PrepareViewport() 249 void RtViewerView::PrepareViewport()
250 { 250 {
251 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); 251 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock());
252
253 /**
254 * The method "RefreshCanvasSize()" must be used before the first
255 * rendering, or when the layout of the HTML page changes, which
256 * does not trigger the "emscripten_set_resize_callback()" event
257 **/
258 lock->RefreshCanvasSize();
259
252 ViewportController& controller = lock->GetController(); 260 ViewportController& controller = lock->GetController();
253 ICompositor& compositor = lock->GetCompositor(); 261 ICompositor& compositor = lock->GetCompositor();
254 262
255 // False means we do NOT let a hi-DPI aware desktop managedr treat this as a legacy application that requires 263 // False means we do NOT let a hi-DPI aware desktop managedr treat this as a legacy application that requires
256 // scaling. 264 // scaling.