summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-08-03 17:03:22 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-08-03 17:03:22 +0300
commit497a151fb923675cc6fae139bcdde1678be195bd (patch)
treed50aaa0aa62da430d51d8497c0b02e2480fa2581 /indra/llui
parent48ccc7ccfbe3e94f9dd78ced588e0a76d03fe070 (diff)
parentf9f3c5eeb2362e388c1d857626d276bbbd40edcf (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llui.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index ee308f575a..5d8b628776 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -477,8 +477,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
}
// add in offset of current image to current ui translation
- const LLVector3 ui_translation = gGL.getUITranslation() + LLVector3(x, y, 0.f);
const LLVector3 ui_scale = gGL.getUIScale();
+ const LLVector3 ui_translation = (gGL.getUITranslation() + LLVector3(x, y, 0.f)).scaledVec(ui_scale);
F32 uv_width = uv_outer_rect.getWidth();
F32 uv_height = uv_outer_rect.getHeight();
@@ -514,8 +514,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
F32 shrink_scale = 1.f - llmax(shrink_width_ratio, shrink_height_ratio);
draw_center_rect.mLeft = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * shrink_scale * ui_scale.mV[VX]);
- draw_center_rect.mTop = llround(ui_translation.mV[VY] + lerp((F32)height, (F32)draw_center_rect.mTop, shrink_scale * ui_scale.mV[VY]));
- draw_center_rect.mRight = llround(ui_translation.mV[VX] + lerp((F32)width, (F32)draw_center_rect.mRight, shrink_scale * ui_scale.mV[VX]));
+ draw_center_rect.mTop = llround(ui_translation.mV[VY] + lerp((F32)height, (F32)draw_center_rect.mTop, shrink_scale) * ui_scale.mV[VY]);
+ draw_center_rect.mRight = llround(ui_translation.mV[VX] + lerp((F32)width, (F32)draw_center_rect.mRight, shrink_scale) * ui_scale.mV[VX]);
draw_center_rect.mBottom = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * shrink_scale * ui_scale.mV[VY]);
}
@@ -735,17 +735,21 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
gGL.begin(LLRender::QUADS);
{
+ LLVector3 ui_scale = gGL.getUIScale();
LLVector3 ui_translation = gGL.getUITranslation();
ui_translation.mV[VX] += x;
ui_translation.mV[VY] += y;
+ ui_translation.scaleVec(ui_scale);
S32 index = 0;
+ S32 scaled_width = llround(width * ui_scale.mV[VX]);
+ S32 scaled_height = llround(height * ui_scale.mV[VY]);
uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop);
- pos[index] = LLVector3(ui_translation.mV[VX] + width, ui_translation.mV[VY] + height, 0.f);
+ pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f);
index++;
uv[index] = LLVector2(uv_rect.mLeft, uv_rect.mTop);
- pos[index] = LLVector3(ui_translation.mV[VX], ui_translation.mV[VY] + height, 0.f);
+ pos[index] = LLVector3(ui_translation.mV[VX], ui_translation.mV[VY] + scaled_height, 0.f);
index++;
uv[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom);
@@ -753,7 +757,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
index++;
uv[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom);
- pos[index] = LLVector3(ui_translation.mV[VX] + width, ui_translation.mV[VY], 0.f);
+ pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY], 0.f);
index++;
gGL.vertexBatchPreTransformed(pos, uv, NUM_VERTICES);