diff options
| author | lempamo <[email protected]> | 2017-10-29 11:44:46 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-10-29 11:44:46 -0500 |
| commit | 4f0c0ce2d3c39c987f914ce28d1767ba49bd945d (patch) | |
| tree | 9eb620ca8fd4b49319f304f37ef2cdcc409951d8 | |
| parent | 8e4a1ec92b493520cc3aca6a67699801cb4be617 (diff) | |
| parent | c4acd5e5bdc18c86c417880e01685d7cf28902aa (diff) | |
| download | histacom2-4f0c0ce2d3c39c987f914ce28d1767ba49bd945d.tar.gz histacom2-4f0c0ce2d3c39c987f914ce28d1767ba49bd945d.tar.bz2 histacom2-4f0c0ce2d3c39c987f914ce28d1767ba49bd945d.zip | |
Merge pull request #170 from AdmAlexus/master
Fix V3029 warnings from PVS-Studio Static Analyzer
| -rw-r--r-- | Histacom2.Engine/Template/WinClassic.cs | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index 25cbfaa..39c7468 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -88,8 +88,11 @@ namespace Histacom2.Engine.Template { var toDraw = resizer.ToDraw; if (resizable) { - if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } } resizer.ToDraw = toDraw; } @@ -100,8 +103,11 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Y = this.Location.Y; - if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y; + if (resizable) + { + toDraw.Y = this.Location.Y; + toDraw.Height = MousePosition.Y - this.Location.Y; + } resizer.ToDraw = toDraw; } } @@ -111,8 +117,13 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; - if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y; + if (resizable) + { + if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) + toDraw.Width = MousePosition.X - this.Location.X; + toDraw.Height = MousePosition.Y - this.Location.Y; + } + resizer.ToDraw = toDraw; } } @@ -122,9 +133,15 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X); - if (resizable) toDraw.Height = Cursor.Position.Y - this.Location.Y; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; + if (resizable) + { + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } + toDraw.Height = Cursor.Position.Y - this.Location.Y; + } resizer.ToDraw = toDraw; } } @@ -134,10 +151,16 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; - if (resizable) toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } + toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } @@ -147,8 +170,11 @@ namespace Histacom2.Engine.Template if(e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } @@ -158,9 +184,12 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; - if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; + toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } |
