diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-05-27 18:35:01 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-05-27 18:35:01 +0200 |
| commit | 4d1f3264dc4b4ddc211164712e0d2d654a913bb7 (patch) | |
| tree | 30655ea8f740eaf115a06c2ebfaaad29a7bcb39e /src/GraphicObjects/Popper.cs | |
| parent | 8d385b053423c16e18d02467bdd54be17c3b42aa (diff) | |
c native GraphicObject implementation, work in progressTestKMS
Diffstat (limited to 'src/GraphicObjects/Popper.cs')
| -rw-r--r-- | src/GraphicObjects/Popper.cs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs index 0e5364d6..18e615b5 100644 --- a/src/GraphicObjects/Popper.cs +++ b/src/GraphicObjects/Popper.cs @@ -130,43 +130,43 @@ namespace Crow _content.LayoutChanged += _content_LayoutChanged; } } - void positionContent(LayoutingType lt){ - ILayoutable tc = Content.Parent; + unsafe void positionContent(LayoutingType lt){ + GraphicObject tc = Content.Parent; if (tc == null) return; - Rectangle r = this.ScreenCoordinates (this.Slot); + Rectangle r = this.ScreenCoordinates (this.nativeHnd->Slot); if (lt == LayoutingType.X) { if (popDirection.HasFlag (Alignment.Right)) { - if (r.Right + Content.Slot.Width > tc.ClientRectangle.Right) - Content.Left = r.Left - Content.Slot.Width; + if (r.Right + Content.nativeHnd->Slot.Width > tc.ClientRectangle.Right) + Content.Left = r.Left - Content.nativeHnd->Slot.Width; else Content.Left = r.Right; } else if (popDirection.HasFlag (Alignment.Left)) { - if (r.Left - Content.Slot.Width < tc.ClientRectangle.Left) + if (r.Left - Content.nativeHnd->Slot.Width < tc.ClientRectangle.Left) Content.Left = r.Right; else - Content.Left = r.Left - Content.Slot.Width; + Content.Left = r.Left - Content.nativeHnd->Slot.Width; } else { - if (Content.Slot.Width < tc.ClientRectangle.Width) { - if (r.Left + Content.Slot.Width > tc.ClientRectangle.Right) - Content.Left = tc.ClientRectangle.Right - Content.Slot.Width; + if (Content.nativeHnd->Slot.Width < tc.ClientRectangle.Width) { + if (r.Left + Content.nativeHnd->Slot.Width > tc.ClientRectangle.Right) + Content.Left = tc.ClientRectangle.Right - Content.nativeHnd->Slot.Width; else Content.Left = r.Left; } else Content.Left = 0; } }else if (lt == LayoutingType.Y) { - if (Content.Slot.Height < tc.ClientRectangle.Height) { + if (Content.nativeHnd->Slot.Height < tc.ClientRectangle.Height) { if (PopDirection.HasFlag (Alignment.Bottom)) { - if (r.Bottom + Content.Slot.Height > tc.ClientRectangle.Bottom) - Content.Top = r.Top - Content.Slot.Height; + if (r.Bottom + Content.nativeHnd->Slot.Height > tc.ClientRectangle.Bottom) + Content.Top = r.Top - Content.nativeHnd->Slot.Height; else Content.Top = r.Bottom; } else if (PopDirection.HasFlag (Alignment.Top)) { - if (r.Top - Content.Slot.Height < tc.ClientRectangle.Top) + if (r.Top - Content.nativeHnd->Slot.Height < tc.ClientRectangle.Top) Content.Top = r.Bottom; else - Content.Top = r.Top - Content.Slot.Height; + Content.Top = r.Top - Content.nativeHnd->Slot.Height; } else Content.Top = r.Top; }else |