Fixed DrawLine

This commit is contained in:
Flamefire committed 2013-05-01 23:27:40 +02:00
1 parent c5f5266126
commit 35bbc0f7a5
2 files changed
+9 -4

No files matched your search

+1 -2
View File
@@ -19,7 +19,6 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms;
using Vocaluxe.Lib.Draw; using Vocaluxe.Lib.Draw;
using VocaluxeLib.Menu; using VocaluxeLib.Menu;
@@ -205,7 +204,7 @@ namespace Vocaluxe.Base
CHelper.SetRect(bounds, out rect, rect.Width / rect.Height, aspect); CHelper.SetRect(bounds, out rect, rect.Width / rect.Height, aspect);
DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, staticBounds.Rect.Z), DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, staticBounds.Rect.Z),
texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false); texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
} }
public static void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) public static void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
+8 -2
View File
@@ -758,8 +758,14 @@ namespace Vocaluxe.Lib.Draw
/// <param name="y2">The end y-value</param> /// <param name="y2">The end y-value</param>
public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2)
{ {
SColorF color = new SColorF((float)a / 255, (float)g / 255, (float)b / 255, (float)a / 255); var lineVector = new Vector2[] {new Vector2(x1, y1), new Vector2(x2, y2)};
DrawTexture(_BlankTexture, new SRectF(x1, y1, x2, y2, 1), color); using (var line = new Line(_Device))
{
line.Antialias = true;
line.Begin();
line.Draw(lineVector, new Color4((float)a / 255, (float)r / 255, (float)g / 255, (float)b / 255));
line.End();
}
} }
/// <summary> /// <summary>