Skip to content

Commit

Permalink
Merge pull request #840 from imerr/master
Browse files Browse the repository at this point in the history
[WPF] Only take border size into account when decorated
  • Loading branch information
sevoku committed Dec 12, 2018
2 parents 1ed5da5 + 490b7e6 commit cafb671
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Xwt.WPF/Xwt.WPFBackend/WindowFrameBackend.cs
Expand Up @@ -407,13 +407,12 @@ protected Rectangle ToNonClientRect (Rectangle rect)
var size = rect.Size;
var loc = rect.Location;

var border = GetBorderSize ();
size.Height += border.Height * 2;
size.Width += border.Width * 2;
loc.X -= border.Width;
loc.Y -= border.Height;

if (((IWindowFrameBackend)this).Decorated) {
var border = GetBorderSize ();
size.Height += border.Height * 2;
size.Width += border.Width * 2;
loc.X -= border.Width;
loc.Y -= border.Height;
size.Height += SystemParameters.WindowCaptionHeight;
loc.Y -= SystemParameters.WindowCaptionHeight;
}
Expand All @@ -430,13 +429,13 @@ protected Rectangle ToClientRect (Rectangle rect)
var size = rect.Size;
var loc = rect.Location;

var border = GetBorderSize ();
size.Height -= border.Height * 2;
size.Width -= border.Width * 2;
loc.X += border.Width;
loc.Y += border.Height;

if (((IWindowFrameBackend)this).Decorated) {
var border = GetBorderSize ();
size.Height -= border.Height * 2;
size.Width -= border.Width * 2;
loc.X += border.Width;
loc.Y += border.Height;
size.Height -= SystemParameters.WindowCaptionHeight;
loc.Y += SystemParameters.WindowCaptionHeight;
}
Expand Down

0 comments on commit cafb671

Please sign in to comment.