|
1 | | -using System.ComponentModel; |
| 1 | +#region Copyright (C) |
| 2 | +// --------------------------------------------------------------------------------------------------------------- |
| 3 | +// <copyright file="LogsViewerControl.cs" company="Smurf-IV"> |
| 4 | +// |
| 5 | +// Copyright (C) 2019-2022 Simon Coghlan (Aka Smurf-IV) |
| 6 | +// |
| 7 | +// This program is free software: you can redistribute it and/or modify |
| 8 | +// it under the terms of the GNU General Public License as published by |
| 9 | +// the Free Software Foundation, either version 2 of the License, or |
| 10 | +// any later version. |
| 11 | +// |
| 12 | +// This program is distributed in the hope that it will be useful, |
| 13 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +// GNU General Public License for more details. |
| 16 | +// |
| 17 | +// You should have received a copy of the GNU General Public License |
| 18 | +// along with this program. If not, see http://www.gnu.org/licenses/. |
| 19 | +// </copyright> |
| 20 | +// <summary> |
| 21 | +// Url: https://github.com/Smurf-IV/Elucidate |
| 22 | +// Email: https://github.com/Smurf-IV |
| 23 | +// </summary> |
| 24 | +// -------------------------------------------------------------------------------------------------------------------- |
| 25 | +#endregion |
| 26 | + |
| 27 | +using System.ComponentModel; |
2 | 28 | using System.Drawing; |
3 | 29 | using System.Windows.Forms; |
4 | 30 |
|
@@ -52,6 +78,11 @@ protected override void Paint(Graphics g, Rectangle clipBounds, Rectangle cellBo |
52 | 78 | float.TryParse(values[1], out var mid); |
53 | 79 | float.TryParse(values[2], out var max); |
54 | 80 |
|
| 81 | + if (max <= 0) |
| 82 | + { |
| 83 | + return; |
| 84 | + } |
| 85 | + |
55 | 86 | var lowPercent = low / max; |
56 | 87 | var midPercent = mid / max; |
57 | 88 | // Draws the cell grid |
|
0 commit comments