fasdfsa commited on
Commit
89746cd
·
1 Parent(s): cbf03e6
src/WpfEditor/MainWindow.xaml.cs CHANGED
@@ -956,6 +956,7 @@ namespace WpfEditor
956
  ViewModel.ClearAllRectangles();
957
  //ViewModel.AddRectangle(int Id, double left, double top, double width, double height)
958
 
 
959
  foreach (var item in Editor._lines)
960
  {
961
  if ( item.Characters.Count == 0 )
@@ -974,7 +975,13 @@ namespace WpfEditor
974
  int wdth = selected_rectange["wdth"].Value<int>();
975
  int hght = selected_rectange["hght"].Value<int>();
976
 
977
- _pendingRectangles.Add(selected_rectange); // 等图片显示后再处理 see Image_SizeChanged
 
 
 
 
 
 
978
 
979
 
980
  //var displayPos = Editor.ConvertOriginalToDisplayCoordinates(lft, tp);
 
956
  ViewModel.ClearAllRectangles();
957
  //ViewModel.AddRectangle(int Id, double left, double top, double width, double height)
958
 
959
+ var dic_ = new Dictionary<string, bool>();
960
  foreach (var item in Editor._lines)
961
  {
962
  if ( item.Characters.Count == 0 )
 
975
  int wdth = selected_rectange["wdth"].Value<int>();
976
  int hght = selected_rectange["hght"].Value<int>();
977
 
978
+ if (!dic_.ContainsKey(Id.ToString()))
979
+ {
980
+ _pendingRectangles.Add(selected_rectange); // 等图片显示后再处理 see Image_SizeChanged
981
+ dic_[Id.ToString()] = true;
982
+ }
983
+
984
+
985
 
986
 
987
  //var displayPos = Editor.ConvertOriginalToDisplayCoordinates(lft, tp);
src/WpfEditor/global.cs CHANGED
@@ -43,8 +43,8 @@ namespace WpfEditor
43
 
44
  string dir = Path.GetDirectoryName(pthimg);
45
 
46
- string pth_img = Path.Combine(dir, "data", "img", $"{m5}.txt"); // .parent_path().parent_path() 在C#中不需要
47
- string pth_json = Path.Combine(dir, "data", "json", $"{m5}.json"); // .parent_path().parent_path() 在C#中不需要
48
 
49
  // C#中不需要lexically_normal(),Path.GetFullPath可以规范化路径
50
  pth_img = Path.GetFullPath(pth_img);
 
43
 
44
  string dir = Path.GetDirectoryName(pthimg);
45
 
46
+ string pth_img = Path.Combine(dir, "img", $"{m5}.txt"); // .parent_path().parent_path() 在C#中不需要
47
+ string pth_json = Path.Combine(dir, "json", $"{m5}.json"); // .parent_path().parent_path() 在C#中不需要
48
 
49
  // C#中不需要lexically_normal(),Path.GetFullPath可以规范化路径
50
  pth_img = Path.GetFullPath(pth_img);