Skip to content

Commit 096fb5e

Browse files
author
YCode
committed
chore: 调整 通知
1 parent a37d7f6 commit 096fb5e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
Mounted="OnMounted"
4040
GridType="Dot"
4141
LineType="Step"
42-
Orientation="Vertical"
42+
Orientation="Horizontal"
4343
ToolTemplate="{StaticResource ToolDataTemplate}"
4444
ItemContainerStyle="{StaticResource FluxoNodeStyle}"
4545
Source="{Binding Source}" />

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ protected override void OnCross()
3838
private (Point P0, Point P1, Point P2, Point P3) GetLinePoints(Point source, Point target)
3939
{
4040
var sourceDir = GetConnectorDirection(this.Parameter.SourcePosition);
41+
4142
var targetDir = GetConnectorDirection(this.Parameter.TargetPosition);
4243

4344
this.Parameter.Start = source + new Vector(_spacing * sourceDir.X, _spacing * sourceDir.Y);
@@ -59,15 +60,18 @@ protected override void OnCross()
5960
if (this.Parameter.SourcePosition == this.Parameter.TargetPosition)
6061
{
6162
var p = GetSamePositionPoint();
63+
6264
return (this.Parameter.Start, p, p, this.Parameter.End);
6365
}
6466

6567
var isSameDir = horizontalConnection ? sourceDir.X == targetDir.Y : sourceDir.Y == targetDir.X;
68+
6669
var startGreaterThanEnd = horizontalConnection
6770
? this.Parameter.Start.Y > this.Parameter.End.Y
6871
: this.Parameter.Start.X > this.Parameter.End.X;
6972

7073
var positiveDir = horizontalConnection ? sourceDir.X == 1 : sourceDir.Y == 1;
74+
7175
var shouldFlip = positiveDir
7276
? isSameDir ? !startGreaterThanEnd : startGreaterThanEnd
7377
: isSameDir
@@ -77,13 +81,16 @@ protected override void OnCross()
7781
if (shouldFlip)
7882
{
7983
var sourceTarget = new Point(this.Parameter.Start.X, this.Parameter.End.Y);
84+
8085
var targetSource = new Point(this.Parameter.End.X, this.Parameter.Start.Y);
8186

8287
var pf = horizontalConnection ? sourceTarget : targetSource;
88+
8389
return (this.Parameter.Start, pf, pf, this.Parameter.End);
8490
}
8591

8692
var pp = GetSamePositionPoint();
93+
8794
return (this.Parameter.Start, pp, pp, this.Parameter.End);
8895

8996
(Point P1, Point P2) GetOppositePositionPoints()
@@ -108,6 +115,7 @@ protected override void OnCross()
108115
Point GetSamePositionPoint()
109116
{
110117
var sourceTarget = new Point(this.Parameter.Start.X, this.Parameter.End.Y);
118+
111119
var targetSource = new Point(this.Parameter.End.X, this.Parameter.Start.Y);
112120

113121
if (horizontalConnection)

YCode.Designer.Fluxo/ViewModels/FluxoNotifyPropertyChanged.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public virtual bool OnPropertyChanged<TValue>(ref TValue field, TValue value, [C
1818
{
1919
if (!Equals(field, value))
2020
{
21-
this.OnPropertyChanged(property);
22-
2321
field = value;
2422

2523
this.OnPropertyChanged(property);

0 commit comments

Comments
 (0)