From 8e8d377291ba226116fe82141f955c8d07dfbcdb Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Thu, 10 Jun 2010 20:01:52 +0000
Subject: changes to divide note   - split note in the center   - use "~"
 instead of dash as lyrics for the new note   - update lyric display after
 split

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2479 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 src/screens/UScreenEditSub.pas | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

(limited to 'src/screens')

diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas
index 7956b127..425036b0 100644
--- a/src/screens/UScreenEditSub.pas
+++ b/src/screens/UScreenEditSub.pas
@@ -1072,13 +1072,21 @@ begin
       Note[N] := Note[N-1];
     end;
 
-    // me slightly modify new note
-    Note[CurrentNote].Length := 1;
-    Inc(Note[CurrentNote+1].Start);
-    Dec(Note[CurrentNote+1].Length);
-    Note[CurrentNote+1].Text := '- ';
+    // Note[Cur] and Note[Cur + 1] is identical at this point
+    // modify first note
+    Note[CurrentNote].Length := Note[CurrentNote+1].Length div 2 + Note[CurrentNote+1].Length mod 2;
+
+    // 2nd note
+    Note[CurrentNote+1].Start := Note[CurrentNote].Start + Note[CurrentNote].Length;
+    Note[CurrentNote+1].Length := Note[CurrentNote + 1].Length div 2;
+
+    Note[CurrentNote+1].Text := '~';
     Note[CurrentNote+1].Color := 1;
   end;
+
+  // update lyric display
+  Lyric.AddLine(Lines[0].Current);
+  Lyric.Selected := CurrentNote;
 end;
 
 procedure TScreenEditSub.DeleteNote;
-- 
cgit v1.2.3