Fix color right before wrapping
The buggy Split method was erroneously creating a looping span despite explicitly passing `isLooping: false` parameter because with `beatToInclusive: LoopBeats` wrapping will occur regardless. This messed up with Duration calculations, and eventually caused the last beat default to transition with t=0, when it should really be static.
This commit is contained in:
		
							parent
							
								
									c689198588
								
							
						
					
					
						commit
						991e2a56b7
					
				|  | @ -5,6 +5,7 @@ | |||
| - Added LobbyCompatibility to dependencies to avoid desync issues. | ||||
| - Fixed lyrics not being displayed in some situations. | ||||
| - Fixed minor visual issue with the fade out effect. | ||||
| - Fixed visual glitch at the last beat of a loop. | ||||
| 
 | ||||
| ## MuzikaGromche 13.37.911 - Sri Lanka Bus hotfix | ||||
| 
 | ||||
|  |  | |||
|  | @ -921,26 +921,20 @@ namespace MuzikaGromche | |||
|         } | ||||
| 
 | ||||
|         public readonly float Duration() | ||||
|         { | ||||
|             return Split().Sum(span => span.BeatToInclusive - span.BeatFromExclusive); | ||||
|         } | ||||
| 
 | ||||
|         public readonly BeatTimeSpan[] Split() | ||||
|         { | ||||
|             if (IsEmpty()) | ||||
|             { | ||||
|                 return []; | ||||
|                 return 0f; | ||||
|             } | ||||
|             else if (IsWrapped()) | ||||
|             { | ||||
|                 return [ | ||||
|                     new BeatTimeSpan(LoopBeats, isLooping: false, beatFromExclusive: /* epsilon */ -0.001f, beatToInclusive: BeatToInclusive), | ||||
|                     new BeatTimeSpan(LoopBeats, isLooping: false, beatFromExclusive: BeatFromExclusive, beatToInclusive: LoopBeats), | ||||
|                 ]; | ||||
|                 var beforeWrapping = LoopBeats - BeatFromExclusive; | ||||
|                 var afterWrapping = BeatToInclusive - 0f; | ||||
|                 return beforeWrapping + afterWrapping; | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 return [this]; | ||||
|                 return BeatToInclusive - BeatFromExclusive; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  | @ -1197,7 +1191,6 @@ namespace MuzikaGromche | |||
|             // | ||||
|             // Otherwise there is no transition running at this time. | ||||
|             const float currentClipLength = 1f; | ||||
|             // var currentClipSpan = BeatTimespan timestamp.Floor() | ||||
|             var currentClipStart = timestamp.Floor(); | ||||
|             var currentClipEnd = currentClipStart + currentClipLength; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue