mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +01:00
Make single HEAD float to the center
This commit is contained in:
parent
c49fa2f7d4
commit
814caca382
2 changed files with 7 additions and 5 deletions
|
@ -14,10 +14,6 @@ func _process(_delta):
|
||||||
if not (repository and repository.objects.has(source)):
|
if not (repository and repository.objects.has(source)):
|
||||||
return
|
return
|
||||||
|
|
||||||
if repository.objects[source].type == "head":
|
|
||||||
$Tip.hide()
|
|
||||||
$Line.hide()
|
|
||||||
|
|
||||||
var start = repository.objects[source].position
|
var start = repository.objects[source].position
|
||||||
var end = start + Vector2(0, 60)
|
var end = start + Vector2(0, 60)
|
||||||
|
|
||||||
|
@ -40,3 +36,7 @@ func _process(_delta):
|
||||||
$Line.points[1] -= $Line.points[1].normalized()*30
|
$Line.points[1] -= $Line.points[1].normalized()*30
|
||||||
$Tip.position = $Line.points[1]
|
$Tip.position = $Line.points[1]
|
||||||
$Tip.rotation = PI+$Line.points[0].angle_to($Line.points[1])
|
$Tip.rotation = PI+$Line.points[0].angle_to($Line.points[1])
|
||||||
|
|
||||||
|
if repository.objects[source].type == "head":
|
||||||
|
$Tip.hide()
|
||||||
|
$Line.hide()
|
||||||
|
|
|
@ -164,7 +164,9 @@ func update_refs():
|
||||||
|
|
||||||
func apply_forces():
|
func apply_forces():
|
||||||
for o in objects.values():
|
for o in objects.values():
|
||||||
if not o.visible or o.type == "head":
|
if not o.visible:
|
||||||
|
continue
|
||||||
|
if o.type == "head" and o.children.size() > 0 and objects.has(o.children.keys()[0]):
|
||||||
continue
|
continue
|
||||||
for o2 in objects.values():
|
for o2 in objects.values():
|
||||||
if o == o2 or not o2.visible or o2.type == "head":
|
if o == o2 or not o2.visible or o2.type == "head":
|
||||||
|
|
Loading…
Reference in a new issue