Now use the new MeasureText function.
This commit is contained in:
parent
f2ac359999
commit
f347036a6b
1 changed files with 3 additions and 2 deletions
|
@ -37,6 +37,8 @@ namespace OpenTK.Graphics
|
||||||
// Interleaved, vertex, texcoord, vertex, etc... Starts with 8 chars, will expand as needed.
|
// Interleaved, vertex, texcoord, vertex, etc... Starts with 8 chars, will expand as needed.
|
||||||
Vector2[] vertices = new Vector2[8 * 8];
|
Vector2[] vertices = new Vector2[8 * 8];
|
||||||
ushort[] indices = new ushort[6 * 8];
|
ushort[] indices = new ushort[6 * 8];
|
||||||
|
IList<RectangleF> ranges = new List<RectangleF>();
|
||||||
|
|
||||||
|
|
||||||
#region --- Constructors ---
|
#region --- Constructors ---
|
||||||
|
|
||||||
|
@ -206,8 +208,7 @@ namespace OpenTK.Graphics
|
||||||
|
|
||||||
if (alignment == StringAlignment.Near && !rightToLeft || alignment == StringAlignment.Far && rightToLeft)
|
if (alignment == StringAlignment.Near && !rightToLeft || alignment == StringAlignment.Far && rightToLeft)
|
||||||
{
|
{
|
||||||
ICollection<RectangleF> ranges = new List<RectangleF>();
|
font.MeasureText(text, SizeF.Empty, null, ranges);
|
||||||
font.MeasureCharacterRanges(text, ref ranges);
|
|
||||||
|
|
||||||
int current = 0;
|
int current = 0;
|
||||||
//foreach (char c in text)
|
//foreach (char c in text)
|
||||||
|
|
Loading…
Reference in a new issue