mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-06 16:25:59 +02:00
Fixed jittering centering
This commit is contained in:
parent
4882a0a1aa
commit
9465247dfe
1 changed files with 5 additions and 1 deletions
|
@ -854,7 +854,11 @@ namespace Beefy.gfx
|
|||
fontMetrics.mMaxWidth = Math.Max(fontMetrics.mMaxWidth, aWidth);
|
||||
|
||||
if (justification == 0)
|
||||
useX += (width - aWidth) / 2;
|
||||
{
|
||||
// This strange-looking construct is so that odd-length lines and even-length lines do not 'jitter'
|
||||
// relative to each other as we're resizing a window
|
||||
useX += ((int)(width)&~1 - (int)aWidth) / 2;
|
||||
}
|
||||
else if (justification == 1)
|
||||
useX += width - aWidth;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue