This commit is contained in:
Paul Chote
2010-07-11 01:59:37 +12:00
parent 788e99fc7f
commit 96c80f357c
3 changed files with 14 additions and 11 deletions

View File

@@ -141,10 +141,12 @@ namespace OpenRA.Widgets
// Inset text by the margin and center vertically
var textPos = pos + new int2( margin, (Bounds.Height - textSize.Y)/2 - VisualHeight);
// Right align and scissor when the text overflows
// Right align when editing and scissor when the text overflows
if (textSize.X > Bounds.Width - 2*margin)
{
textPos += new int2(Bounds.Width - 2*margin - textSize.X,0);
if (Chrome.selectedWidget == this)
textPos += new int2(Bounds.Width - 2*margin - textSize.X,0);
Game.chrome.renderer.Device.EnableScissor(pos.X + margin, pos.Y, Bounds.Width - 2*margin, Bounds.Bottom);
}