Bug Fix
This commit is contained in:
25
Scenes/SelfBond.cs
Normal file
25
Scenes/SelfBond.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
using VirtualChemDemo.Concepts;
|
||||
|
||||
namespace VirtualChemDemo.Scenes;
|
||||
|
||||
public partial class SelfBond : Bond2D
|
||||
{
|
||||
public override void BondUpdate()
|
||||
{
|
||||
Reindex();
|
||||
List<Vector2> points = new();
|
||||
Vector2 pcenter = new(30, 0);
|
||||
pcenter = pcenter.Rotated((float)Index * Mathf.Pi * 2f / (float)Multi);
|
||||
Vector2 center = AtomFrom.Position + new Vector2(32, 32) + pcenter;
|
||||
Vector2 d = AtomFrom.Position + new Vector2(32, 32) - center;
|
||||
for (int i = 0; i <= 24; i++)
|
||||
points.Add(center + d.Rotated(i*Mathf.Pi*2/24));
|
||||
BondTypeA.Position = points[12] + new Vector2(-20, 0);
|
||||
BondTypeB.Position = points[12] + new Vector2(20, 0);
|
||||
Points = points.ToArray();
|
||||
BondTypeA.Text = BondFrom.BondType;
|
||||
BondTypeB.Text = BondTo.BondType;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user