From 56bde936b98ec82685f73261f3d7bbbe2ff9f444 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Wed, 27 Feb 2013 18:44:24 +0100 Subject: [PATCH] try to fix bug #11 please test --- VocaluxeLib/Menu/SingNotes/CSingNotes.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/VocaluxeLib/Menu/SingNotes/CSingNotes.cs b/VocaluxeLib/Menu/SingNotes/CSingNotes.cs index f273604c..aaa648ee 100644 --- a/VocaluxeLib/Menu/SingNotes/CSingNotes.cs +++ b/VocaluxeLib/Menu/SingNotes/CSingNotes.cs @@ -530,7 +530,12 @@ namespace Vocaluxe.Menu.SingNotes CBase.Drawing.DrawTexture(NoteBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), Color); - CBase.Drawing.DrawTexture(NoteMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), Color); + + if (r.W - 2 * dx >= 2 * dx) + CBase.Drawing.DrawTexture(NoteMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), Color); + else + CBase.Drawing.DrawTexture(NoteMiddle, new SRectF(r.X + dx, r.Y, 2 * dx, r.H, r.Z), Color, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z)); + CBase.Drawing.DrawTexture(NoteEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), Color); } @@ -573,7 +578,12 @@ namespace Vocaluxe.Menu.SingNotes SColorF col = new SColorF(Color.R, Color.G, Color.B, Color.A * alpha); CBase.Drawing.DrawTexture(NoteBackgroundBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), col); - CBase.Drawing.DrawTexture(NoteBackgroundMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), col); + + if (r.W - 2 * dx >= 2 * dx) + CBase.Drawing.DrawTexture(NoteBackgroundMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), col); + else + CBase.Drawing.DrawTexture(NoteBackgroundMiddle, new SRectF(r.X + dx, r.Y, 2 * dx, r.H, r.Z), col, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z)); + CBase.Drawing.DrawTexture(NoteBackgroundEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), col); }