mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 03:35:10 +00:00
Got rid of unnecessary calculations
This commit is contained in:
parent
a8b5d3ed7f
commit
0b94364593
1 changed files with 1 additions and 2 deletions
|
@ -83,14 +83,13 @@ namespace RhythmHeavenMania.Editor.Track
|
||||||
|
|
||||||
// thank you to @chrislo27 for suggesting the fix for this.
|
// thank you to @chrislo27 for suggesting the fix for this.
|
||||||
// only renders blocks if they're in view of the timeline viewport
|
// only renders blocks if they're in view of the timeline viewport
|
||||||
bool visible = rectTransform.IsVisibleFrom(Editor.instance.EditorCamera);
|
|
||||||
var leftSide = rectTransform.localPosition.x;
|
var leftSide = rectTransform.localPosition.x;
|
||||||
var rightSide = leftSide + rectTransform.sizeDelta.x;
|
var rightSide = leftSide + rectTransform.sizeDelta.x;
|
||||||
|
|
||||||
var timelineLeftSide = (Timeline.instance.TimelineContent.localPosition.x / 100f) * -1;
|
var timelineLeftSide = (Timeline.instance.TimelineContent.localPosition.x / 100f) * -1;
|
||||||
var timelineRightSide = timelineLeftSide + 10.563f; // what a magic number, i'm sure I could calculate this but I'm lazy
|
var timelineRightSide = timelineLeftSide + 10.563f; // what a magic number, i'm sure I could calculate this but I'm lazy
|
||||||
|
|
||||||
visible = (rightSide >= timelineLeftSide && leftSide <= timelineRightSide);
|
bool visible = (rightSide >= timelineLeftSide && leftSide <= timelineRightSide);
|
||||||
|
|
||||||
|
|
||||||
if (visible != lastVisible)
|
if (visible != lastVisible)
|
||||||
|
|
Loading…
Reference in a new issue