Skip to content

Commit 7223de5

Browse files
committed
Fix drag resize not correct in some situations
1 parent dc5a1a6 commit 7223de5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/UI/Editor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ private void Open()
11391139
AllowedTypes = new List<IAllowedType>(new[] { new AllowedType("View", SourceCodeFile.ExpectedExtension) })
11401140
};
11411141
ofd.SetupNiceColorSchemes();
1142+
ofd.Layout();
11421143

11431144
Application.Run(ofd, this.ErrorHandler);
11441145

@@ -1219,6 +1220,7 @@ private void New()
12191220
AllowedTypes = new List<IAllowedType>() { new AllowedType("C# File", ".cs") },
12201221
Path = "MyView.cs",
12211222
};
1223+
ofd.Layout();
12221224
ofd.SetupNiceColorSchemes();
12231225

12241226
Application.Run(ofd);

src/UI/ValueFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ internal static bool GetNewValue(string propertyName, Design design, Type type,
193193
var fd = new FileDialog();
194194
fd.SetupNiceColorSchemes();
195195
fd.AllowsMultipleSelection = false;
196+
fd.Layout();
196197

197198
int answer = ChoicesDialog.Query(propertyName, $"Directory or File?", "Directory", "File", "Cancel");
198199

src/ViewExtensions.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ public static bool IsBorderlessContainerView(this View v)
256256
{
257257
v.Visible = false;
258258
}
259-
260-
var point = w.ScreenToContent(m.Position);
261259

262260
var hit = ViewExtensions.FindDeepestView(m.Position);
263261

@@ -269,10 +267,10 @@ public static bool IsBorderlessContainerView(this View v)
269267
{
270268
var screenFrame = hit.FrameToScreen();
271269

272-
if (point != new Point(screenFrame.X, screenFrame.Y))
270+
if (m.Position != new Point(screenFrame.X, screenFrame.Y))
273271
{
274-
isLowerRight = Math.Abs(screenFrame.X + screenFrame.Width - point.X) <= resizeBoxArea
275-
&& Math.Abs(screenFrame.Y + screenFrame.Height - point.Y) <= resizeBoxArea;
272+
isLowerRight = Math.Abs(screenFrame.X + screenFrame.Width - m.Position.X) <= resizeBoxArea
273+
&& Math.Abs(screenFrame.Y + screenFrame.Height - m.Position.Y) <= resizeBoxArea;
276274
}
277275
else
278276
{

0 commit comments

Comments
 (0)