From 910a1d704e35d5789e4a8c34efa89ed8d7f3bf9d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 6 Nov 2018 17:11:22 +0200 Subject: SL-10001 Fixed position parameters trembling at the top of the page when moving --- indra/newview/llmanip.cpp | 71 ++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'indra/newview/llmanip.cpp') diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 8567180dd6..1dc03123eb 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -431,7 +431,6 @@ void LLManip::renderXYZ(const LLVector3 &vec) { const S32 PAD = 10; std::string feedback_string; - LLVector3 camera_pos = LLViewerCamera::getInstance()->getOrigin() + LLViewerCamera::getInstance()->getAtAxis(); S32 window_center_x = gViewerWindow->getWorldViewRectScaled().getWidth() / 2; S32 window_center_y = gViewerWindow->getWorldViewRectScaled().getHeight() / 2; S32 vertical_offset = window_center_y - VERTICAL_OFFSET; @@ -451,37 +450,47 @@ void LLManip::renderXYZ(const LLVector3 &vec) 235, PAD * 2 + 10, LLColor4(0.f, 0.f, 0.f, 0.7f) ); - } - gGL.popMatrix(); - - gViewerWindow->setup3DRender(); - { - LLFontGL* font = LLFontGL::getFontSansSerif(); - LLLocale locale(LLLocale::USER_LOCALE); - LLGLDepthTest gls_depth(GL_FALSE); - // render drop shadowed text - feedback_string = llformat("X: %.3f", vec.mV[VX]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); - - feedback_string = llformat("Y: %.3f", vec.mV[VY]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); - - feedback_string = llformat("Z: %.3f", vec.mV[VZ]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); - - // render text on top - feedback_string = llformat("X: %.3f", vec.mV[VX]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); - - gGL.diffuseColor3f(0.5f, 1.f, 0.5f); - feedback_string = llformat("Y: %.3f", vec.mV[VY]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); - - gGL.diffuseColor3f(0.5f, 0.5f, 1.f); - feedback_string = llformat("Z: %.3f", vec.mV[VZ]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); - } + LLFontGL* font = LLFontGL::getFontSansSerif(); + LLLocale locale(LLLocale::USER_LOCALE); + LLGLDepthTest gls_depth(GL_FALSE); + + // render drop shadowed text (manually because of bigger 'distance') + F32 right_x; + feedback_string = llformat("X: %.3f", vec.mV[VX]); + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 102.f + 1.f, window_center_y + vertical_offset - 2.f, LLColor4::black, + LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); + + feedback_string = llformat("Y: %.3f", vec.mV[VY]); + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 27.f + 1.f, window_center_y + vertical_offset - 2.f, LLColor4::black, + LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); + + feedback_string = llformat("Z: %.3f", vec.mV[VZ]); + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x + 48.f + 1.f, window_center_y + vertical_offset - 2.f, LLColor4::black, + LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); + + // render text on top + feedback_string = llformat("X: %.3f", vec.mV[VX]); + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 102.f, window_center_y + vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), + LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); + + feedback_string = llformat("Y: %.3f", vec.mV[VY]); + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 27.f, window_center_y + vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), + LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); + + feedback_string = llformat("Z: %.3f", vec.mV[VZ]); + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x + 48.f, window_center_y + vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), + LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); + } + gGL.popMatrix(); + + gViewerWindow->setup3DRender(); } void LLManip::renderTickText(const LLVector3& pos, const std::string& text, const LLColor4 &color) -- cgit v1.2.3 From 221201de4eaba585ae713b279a0e9ba1c8fd61cf Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sun, 9 Dec 2018 20:57:36 +0200 Subject: SL-10001 Fixed scale --- indra/newview/llmanip.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview/llmanip.cpp') diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 1dc03123eb..6589aa477f 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -441,14 +441,13 @@ void LLManip::renderXYZ(const LLVector3 &vec) LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); gViewerWindow->setup2DRender(); const LLVector2& display_scale = gViewerWindow->getDisplayScale(); - gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); gGL.color4f(0.f, 0.f, 0.f, 0.7f); imagep->draw( - window_center_x - 115, - window_center_y + vertical_offset - PAD, - 235, - PAD * 2 + 10, + (window_center_x - 115) * display_scale.mV[VX], + (window_center_y + vertical_offset - PAD) * display_scale.mV[VY], + 235 * display_scale.mV[VX], + (PAD * 2 + 10) * display_scale.mV[VY], LLColor4(0.f, 0.f, 0.f, 0.7f) ); LLFontGL* font = LLFontGL::getFontSansSerif(); -- cgit v1.2.3