From 343562889e2b9332942f1c190e0dd6b7ddcb9540 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 25 Oct 2011 19:34:05 -0700 Subject: EXP-1471 WIP Add support for zooming web pages by a scale facxtor --- indra/newview/llmediactrl.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmediactrl.cpp') diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 0bdeb114f5..dd12546bc6 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -113,7 +113,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : } setIgnoreUIScale(p.ignore_ui_scale); - + setHomePageUrl(p.start_url, p.initial_mime_type); setBorderVisible(p.border_visible); @@ -779,6 +779,18 @@ void LLMediaCtrl::draw() floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]), LLFontGL::sCurOrigin.mZ); } + else + { + // zoom is an expensive operation - only do it if value changes + // TODO: move this logic out to mMediaSource->setPageZoomFactor() ?? + static double prev_ui_scale = 0.0f; + double ui_scale = LLUI::sGLScaleFactor.mV[ VX ]; + if ( ui_scale != prev_ui_scale ) + { + mMediaSource->setPageZoomFactor( ui_scale ); + prev_ui_scale = ui_scale; + } + } // scale texture to fit the space using texture coords gGL.getTexUnit(0)->bind(media_texture); -- cgit v1.2.3