File tree Expand file tree Collapse file tree 6 files changed +23
-15
lines changed
tests/Blazor.Diagrams.Core.Tests Expand file tree Collapse file tree 6 files changed +23
-15
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+ ## Diagrams (2.1.5) - 2021-08-30
8
+
9
+ ### Fixed
10
+
11
+ - Links not being removed from the node after they have been removed from the Links layer. (fixes #136 )
12
+ - A regression in ` ZoomToFit ` . (fixes #138 )
13
+
7
14
## Diagrams (2.1.4) - 2021-08-29
8
15
9
16
### Added
Original file line number Diff line number Diff line change 7
7
<PackageLicenseExpression >MIT</PackageLicenseExpression >
8
8
<Authors >zHaytam</Authors >
9
9
<Description >A fully customizable and extensible all-purpose diagrams library for Blazor</Description >
10
- <AssemblyVersion >2.1.4 </AssemblyVersion >
11
- <FileVersion >2.1.4 </FileVersion >
10
+ <AssemblyVersion >2.1.5 </AssemblyVersion >
11
+ <FileVersion >2.1.5 </FileVersion >
12
12
<RepositoryUrl >https://github.com/zHaytam/Blazor.Diagrams</RepositoryUrl >
13
- <Version >2.1.4 </Version >
13
+ <Version >2.1.5 </Version >
14
14
<PackageId >Z.Blazor.Diagrams.Core</PackageId >
15
15
<PackageTags >blazor diagrams diagramming svg drag</PackageTags >
16
16
<Product >Z.Blazor.Diagrams.Core</Product >
Original file line number Diff line number Diff line change @@ -293,15 +293,16 @@ public void ZoomToFit(double margin = 10)
293
293
var minX = bounds . Left - margin ;
294
294
var minY = bounds . Top - margin ;
295
295
296
+ SuspendRefresh = true ;
297
+
296
298
var xf = Container . Width / width ;
297
299
var yf = Container . Height / height ;
300
+ SetZoom ( Math . Min ( xf , yf ) ) ;
298
301
299
302
var nx = Container . Left + Pan . X + minX * Zoom ;
300
303
var ny = Container . Top + Pan . Y + minY * Zoom ;
301
-
302
- SuspendRefresh = true ;
303
- SetZoom ( Math . Min ( xf , yf ) ) ;
304
304
UpdatePan ( Container . Left - nx , Container . Top - ny ) ;
305
+
305
306
SuspendRefresh = false ;
306
307
Refresh ( ) ;
307
308
}
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ protected override void OnItemRemoved(BaseLinkModel link)
38
38
}
39
39
else
40
40
{
41
- link . SourceNode . AddLink ( link ) ;
42
- link . TargetNode ? . AddLink ( link ) ;
41
+ link . SourceNode . RemoveLink ( link ) ;
42
+ link . TargetNode ? . RemoveLink ( link ) ;
43
43
}
44
44
45
45
link . SourceNode . Group ? . Refresh ( ) ;
Original file line number Diff line number Diff line change 5
5
<RazorLangVersion >3.0</RazorLangVersion >
6
6
<Authors >zHaytam</Authors >
7
7
<PackageLicenseExpression >MIT</PackageLicenseExpression >
8
- <AssemblyVersion >2.1.4 </AssemblyVersion >
9
- <FileVersion >2.1.4 </FileVersion >
8
+ <AssemblyVersion >2.1.5 </AssemblyVersion >
9
+ <FileVersion >2.1.5 </FileVersion >
10
10
<RepositoryUrl >https://github.com/zHaytam/Blazor.Diagrams</RepositoryUrl >
11
11
<Description >A fully customizable and extensible all-purpose diagrams library for Blazor</Description >
12
- <Version >2.1.4 </Version >
12
+ <Version >2.1.5 </Version >
13
13
<GeneratePackageOnBuild >true</GeneratePackageOnBuild >
14
14
<PackageTags >blazor diagrams diagramming svg drag</PackageTags >
15
15
<PackageId >Z.Blazor.Diagrams</PackageId >
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ public void ZoomToFit_ShouldUseSelectedNodesIfAny()
41
41
42
42
// Assert
43
43
diagram . Zoom . Should ( ) . BeApproximately ( 7.68 , 0.001 ) ;
44
- diagram . Pan . X . Should ( ) . Be ( - 40 ) ;
45
- diagram . Pan . Y . Should ( ) . Be ( - 40 ) ;
44
+ diagram . Pan . X . Should ( ) . Be ( - 307.2 ) ;
45
+ diagram . Pan . Y . Should ( ) . Be ( - 307.2 ) ;
46
46
}
47
47
48
48
[ Fact ]
@@ -61,8 +61,8 @@ public void ZoomToFit_ShouldUseNodesWhenNoneSelected()
61
61
62
62
// Assert
63
63
diagram . Zoom . Should ( ) . BeApproximately ( 7.68 , 0.001 ) ;
64
- diagram . Pan . X . Should ( ) . Be ( - 40 ) ;
65
- diagram . Pan . Y . Should ( ) . Be ( - 40 ) ;
64
+ diagram . Pan . X . Should ( ) . Be ( - 307.2 ) ;
65
+ diagram . Pan . Y . Should ( ) . Be ( - 307.2 ) ;
66
66
}
67
67
68
68
[ Fact ]
You can’t perform that action at this time.
0 commit comments