From 01e1ead0a40bb61d861e123d79b49382037576e8 Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Tue, 12 Apr 2016 21:19:42 +0200 Subject: [PATCH] Fix 1px gap appearing in notes of certain lengths --- VocaluxeLib/Menu/SingNotes/CNoteBars.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/VocaluxeLib/Menu/SingNotes/CNoteBars.cs b/VocaluxeLib/Menu/SingNotes/CNoteBars.cs index 853d71f4..efced613 100644 --- a/VocaluxeLib/Menu/SingNotes/CNoteBars.cs +++ b/VocaluxeLib/Menu/SingNotes/CNoteBars.cs @@ -258,9 +258,14 @@ namespace VocaluxeLib.Menu.SingNotes SRectF lastMidRect = new SRectF(middleRect.X + midCount * midW, noteRect.Y, middleRect.W - (midCount * midW), noteRect.H, noteRect.Z); + //gapAdjust fixes 1px empty gap appearing with certain note lengths. + float gapAdjust = 0f; + if (lastMidRect.W < 1) + gapAdjust = lastMidRect.W; + CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X + (midCount * midW), middleRect.Y, midW, middleRect.H, middleRect.Z), color, lastMidRect); - CBase.Drawing.DrawTexture(noteEnd, new SRectF(noteRect.X + noteRect.W - endsW, noteRect.Y, endsW, noteRect.H, noteRect.Z), color); + CBase.Drawing.DrawTexture(noteEnd, new SRectF(noteRect.X + noteRect.W - endsW - gapAdjust, noteRect.Y, endsW, noteRect.H, noteRect.Z), color); } private void _DrawNoteBase(SRectF rect, SColorF color, float factor)