diff options
author | richard <none@none> | 2009-11-16 15:47:45 -0800 |
---|---|---|
committer | richard <none@none> | 2009-11-16 15:47:45 -0800 |
commit | b38ca5ec323beecd7fa431addb021199c85764f6 (patch) | |
tree | ea794f4f40d45bddc794bbac840603beac113e1d /indra/newview/llmediactrl.cpp | |
parent | 81b64fd88be9793688c0924bcc25aa38b0ba85b4 (diff) |
fix for UI scale != 1.0 breaking edit tools, web browser, world view rect, etc.
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 8f29f908e5..c79adb85e5 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -101,17 +101,17 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : setCaretColor( (unsigned int)color.mV[0], (unsigned int)color.mV[1], (unsigned int)color.mV[2] ); } - setIgnoreUIScale(p.ignore_ui_scale()); + setIgnoreUIScale(p.ignore_ui_scale); - setHomePageUrl(p.start_url()); + setHomePageUrl(p.start_url); - setBorderVisible(p.border_visible()); + setBorderVisible(p.border_visible); - mHideLoading = p.hide_loading(); + mHideLoading = p.hide_loading; - setDecoupleTextureSize(p.decouple_texture_size()); + setDecoupleTextureSize(p.decouple_texture_size); - setTextureSize(p.texture_width(), p.texture_height()); + setTextureSize(p.texture_width, p.texture_height); if(!getDecoupleTextureSize()) { @@ -723,13 +723,13 @@ void LLMediaCtrl::draw() { // max width, adjusted height width = r.getWidth(); - height = llmin(llmax(S32(width / media_aspect), 0), r.getHeight()); + height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight()); } else { // max height, adjusted width height = r.getHeight(); - width = llmin(llmax(S32(height * media_aspect), 0), r.getWidth()); + width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth()); } } else @@ -747,6 +747,14 @@ void LLMediaCtrl::draw() x_offset = (r.getWidth() - width) / 2; y_offset = (r.getHeight() - height) / 2; + if(mIgnoreUIScale) + { + x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]); + y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]); + width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]); + height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]); + } + // draw the browser gGL.setSceneBlendType(LLRender::BT_REPLACE); gGL.begin( LLRender::QUADS ); |