Skip to content

Commit 9828caf

Browse files
author
YCode
committed
feat: Straight vertical line
1 parent 3ca8ad1 commit 9828caf

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

YCode.Designer.Demo/Demo/Playground/Playground.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
Mounting="OnMounting"
3939
Mounted="OnMounted"
4040
GridType="Dot"
41+
Orientation="Vertical"
4142
ToolTemplate="{StaticResource ToolDataTemplate}"
4243
ItemContainerStyle="{StaticResource FluxoNodeStyle}"
4344
Source="{Binding Source}" />

YCode.Designer.Fluxo/Lines/Impl/FluxoStraightLine.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@ protected override void OnHorizontal()
3535

3636
protected override void OnVertical()
3737
{
38-
throw new NotImplementedException();
38+
this.Parameter.Start = this.Parameter.Source.Top;
39+
40+
this.Parameter.End = this.Parameter.Target.Top;
41+
42+
if (this.Parameter.Source.Bottom.X < this.Parameter.Target.Top.X)
43+
{
44+
this.Parameter.Start = this.Parameter.Source.Bottom;
45+
}
46+
else if (this.Parameter.Target.Bottom.X < this.Parameter.Source.Top.X)
47+
{
48+
this.Parameter.End = this.Parameter.Target.Bottom;
49+
}
50+
51+
this.Points.AddRanage([this.Parameter.Start, this.Parameter.End]);
3952
}
4053

4154
protected override void OnCross()

0 commit comments

Comments
 (0)