{"id":452440,"date":"2025-03-20T09:00:50","date_gmt":"2025-03-20T09:00:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=452440"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=452440","title":{"rendered":"<span>\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043e\u0445: \u0447\u0442\u043e \u0442\u0430\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 ScottPlot?<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>ScottPlot \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434 .NET \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432. \u0418\u0437-\u0437\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u0445 \u043a\u043e\u0434 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u0443\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u043e\u0442\u044b\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/5f1\/91a\/7be\/5f191a7be7f6c267ea3447db688dd4d2.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/5f1\/91a\/7be\/5f191a7be7f6c267ea3447db688dd4d2.png\"\/><\/figure>\n<p>\u041e\u0431\u043e \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 ScottPlot \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/scottplot.net\/\">\u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>. \u041d\u0430 \u043d\u0451\u043c \u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0433\u0440\u0430\u0444\u0438\u043a, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67dbc3208f844fa824832811\" data-style=\"\" id=\"67dbc3208f844fa824832811\" width=\"\"><\/div>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435, ScottPlot \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430. \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u0442\u043e\u0438\u0442 \u0443\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u0430. \u0412\u0435\u0434\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u043e \u0438 \u043d\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441 \u0435\u0451 \u043f\u043e\u043c\u043e\u0449\u044c\u044e. \u042d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c ScottPlot \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 <a href=\"https:\/\/pvs-studio.ru\">PVS-Studio<\/a>.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u0442\u043e\u043c\u0443 <a href=\"https:\/\/github.com\/ScottPlot\/ScottPlot\/tree\/fff3fca297c0e05c85e5dc19033504a3454605cf\">\u043a\u043e\u043c\u043c\u0438\u0442\u0443<\/a>.<\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442.<\/p>\n<h3>\u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u0444\u043e\u043a\u0443\u0441\u044b<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 1<\/strong><\/p>\n<pre><code class=\"cs\">public static Interactivity.Key GetKey(this Keys keys) {      Keys keyCode = keys &amp; ~Keys.Modifiers;                   \/\/ &lt;=   Interactivity.Key key = keyCode switch   {     Keys.Alt =&gt; Interactivity.StandardKeys.Alt,            \/\/ &lt;=     Keys.Menu =&gt; Interactivity.StandardKeys.Alt,     Keys.Shift =&gt; Interactivity.StandardKeys.Shift,        \/\/ &lt;=     Keys.ShiftKey =&gt; Interactivity.StandardKeys.Shift,     Keys.LShiftKey =&gt; Interactivity.StandardKeys.Shift,     Keys.RShiftKey =&gt; Interactivity.StandardKeys.Shift,     Keys.Control =&gt; Interactivity.StandardKeys.Control,    \/\/ &lt;=     Keys.ControlKey =&gt; Interactivity.StandardKeys.Control,     Keys.Down =&gt; Interactivity.StandardKeys.Down,     Keys.Up =&gt; Interactivity.StandardKeys.Up,     Keys.Left =&gt; Interactivity.StandardKeys.Left,     Keys.Right =&gt; Interactivity.StandardKeys.Right,     _ =&gt; Interactivity.StandardKeys.Unknown,   };    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3202\/\">V3202<\/a> Unreachable code detected. The &#8216;case&#8217; value is out of range of the match expression. ScottPlot.WinForms FormsPlotExtensions.cs 106<\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 <code>switch<\/code> \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0432 \u0447\u0451\u043c \u0442\u0443\u0442 \u0434\u0435\u043b\u043e.<\/p>\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 &#171;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u043c&#187; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"cs\">[Flags] [TypeConverter(typeof(KeysConverter))] [Editor(....)] public enum Keys {   \/\/\/ &lt;summary&gt;   \/\/\/  The bit mask to extract modifiers from a key value.   \/\/\/ &lt;\/summary&gt;   Modifiers = unchecked((int)0xFFFF0000),    ....   \/\/\/ &lt;summary&gt;   \/\/\/  The SHIFT modifier key.   \/\/\/ &lt;\/summary&gt;   Shift = 0x00010000,    \/\/\/ &lt;summary&gt;   \/\/\/  The  CTRL modifier key.   \/\/\/ &lt;\/summary&gt;   Control = 0x00020000,    \/\/\/ &lt;summary&gt;   \/\/\/  The ALT modifier key.   \/\/\/ &lt;\/summary&gt;   Alt = 0x00040000 } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u0438\u0445 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0418\u043c\u044f<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (10-\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430)<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0411\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (2-\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Modifiers<\/p>\n<\/td>\n<td>\n<p align=\"left\">0xFFFF0000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1111 1111 1111 1111 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Shift<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x00010000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0000 0000 0000 0001 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Control<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x00020000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0000 0000 0000 0010 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Alt<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x00040000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0000 0000 0000 0100 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e <code>Modifiers<\/code> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 &#171;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445&#187; \u0447\u043b\u0435\u043d\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0435 \u0432 <code>switch<\/code>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>keys &amp; ~Keys.Modifiers<\/code>. \u042d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0438\u0437 <code>keys<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>Keys.Modifiers<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u043c\u0438\u043c\u043e <code>Keys.Modifiers<\/code>, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u044b <code>Shift<\/code>, <code>Control<\/code> \u0438 <code>Alt<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a <code>Modifiers<\/code> \u0443\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u0438\u0442\u0430 &#171;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445&#187; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0443 <code>Modifiers<\/code> \u0435\u0441\u0442\u044c \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0431\u0438\u0442).<\/p>\n<p>\u0418\u0437 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0431\u0438\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <code>Shift<\/code>, <code>Control<\/code> \u0438\u043b\u0438 <code>Alt<\/code> \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <code>keys &amp; ~Keys.Modifiers<\/code>.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0430 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>switch<\/code>.<\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 2<\/strong><\/p>\n<pre><code class=\"cs\">internal double BackAngleSweep {   get   {     double maxBackAngle = CircularBackground ? 360 : MaximumSizeAngle;     if (!Clockwise) maxBackAngle = -maxBackAngle;     return maxBackAngle;   }    private set { BackAngleSweep = value; } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3110\/\">V3110<\/a> Possible infinite recursion inside &#8216;BackAngleSweep&#8217; property. ScottPlot RadialGauge.cs 45<\/p>\n<p>\u0412\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f setter&#8217;\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>BackAngleSweep<\/code>. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0433\u043b\u044f\u0434\u0435\u0442\u044c\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 setter&#8217;\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e \u0441\u0435\u0431\u0435. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f &#171;Stack Overflow&#187;.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u043d\u0435\u0442 \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e setter \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 <code>BackAngleSweep<\/code>, \u0442\u043e \u043d\u0435\u043c\u0438\u043d\u0443\u0435\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442 &#171;Stack Overflow&#187;.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 3<\/strong><\/p>\n<pre><code class=\"cs\">public bool Rounded {     get =&gt; StrokeCap == SKStrokeCap.Round;     set { StrokeCap = SKStrokeCap.Round; StrokeJoin = SKStrokeJoin.Round; } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3077\/\">V3077<\/a> The setter of &#8216;Rounded&#8217; property does not utilize its &#8216;value&#8217; parameter. ScottPlot LineStyle.cs 36<\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0442\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 setter&#8217;\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u041f\u0440\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0438 \u0435\u043c\u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e. \u0412\u0441\u0451 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0438 \u0432 <code>value<\/code>, \u043d\u0438 \u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e \u0435\u0449\u0451.<\/p>\n<h3>\u0421\u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c?<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 4<\/strong><\/p>\n<pre><code class=\"cs\">public class CoordinateRangeMutable : IEquatable&lt;CoordinateRangeMutable&gt; {   ....   public bool Equals(CoordinateRangeMutable? other)   {     if (other is null)       return false;      return Equals(Min, other.Min) &amp;&amp; Equals(Min, other.Min);  \/\/ &lt;=   }    public override bool Equals(object? obj)   {     if (obj is null)       return false;      if (obj is CoordinateRangeMutable other)       return Equals(other);      return false;   }    public override int GetHashCode()   {     return Min.GetHashCode() ^ Max.GetHashCode();             \/\/ &lt;=   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3192\/\">V3192<\/a> The &#8216;Max&#8217; property is used in the &#8216;GetHashCode&#8217; method but is missing from the &#8216;Equals&#8217; method. ScottPlot CoordinateRangeMutable.cs 198<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3001\/\">V3001<\/a> There are identical sub-expressions &#8216;Equals(Min, other.Min)&#8217; to the left and to the right of the &#8216;&amp;&amp;&#8217; operator. ScottPlot CoordinateRangeMutable.cs 172<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3192\/\">V3192<\/a>. \u0412 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Max<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>GetHashCode<\/code>, \u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>Equals<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>Equals<\/code>, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0435\u0433\u043e \u0442\u0435\u043b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u0438\u043d <code>Equals<\/code>. \u0412 \u043d\u0451\u043c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c: <code>Equals(Min, other.Min) &amp;&amp; Equals(Min, other.Min)<\/code>. \u0410 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0443\u043a\u0430\u0437\u0430\u043b\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3001\/\">V3001<\/a>.<\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 <code>&amp;&amp;<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434: <code>Equals(Max, other.Max)<\/code>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0430\u0432, \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>Equals<\/code> \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442 <code>Max<\/code>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 5<\/strong><\/p>\n<pre><code class=\"cs\">public class CoordinateRangeMutable : IEquatable&lt;CoordinateRangeMutable&gt; {   ....   public static bool operator ==(CoordinateRangeMutable a,                                   CoordinateRangeMutable b)   {     return a.Equals(b);   }    public static bool operator !=(CoordinateRangeMutable a,                                   CoordinateRangeMutable b)   {     return !a.Equals(b);   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;==&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ScottPlot CoordinateRangeMutable.cs 188<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;!=&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ScottPlot CoordinateRangeMutable.cs 193<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>CoordinateRangeMutable<\/code>. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>==<\/code> \u0438 <code>!=<\/code> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <code>NullReferenceException<\/code>. \u0418 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a: \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 <code>CoordinateRangeMutable<\/code> \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0431\u0443\u0434\u0435\u0442 <code>null<\/code>, \u0442\u043e \u043c\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c <code>NullReferenceException<\/code>.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>Equals<\/code> \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <code>null<\/code>.<\/p>\n<h3>\u0412\u0441\u0435\u0433\u0434\u0430 \u0434\u0430<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 6<\/strong><\/p>\n<pre><code class=\"cs\">private double GetIdealTickSpacing(CoordinateRange range,                                    PixelLength axisLength,                                    PixelLength maxLabelLength) {   int targetTickCount = (int)(axisLength.Length \/ maxLabelLength.Length) + 1;    int radix = 10;                                          \/\/ &lt;=   int exponent = (int)Math.Log(range.Length, radix) + 1;   double initialSpace = Math.Pow(radix, exponent);   List&lt;double&gt; tickSpacings = [initialSpace];    double[] divBy;   if (radix == 10)                                         \/\/ &lt;=     divBy = [2, 2, 2.5]; \/\/ 10, 5, 2.5, 1   else if (radix == 16)     divBy = [2, 2, 2, 2]; \/\/ 16, 8, 4, 2, 1   else     throw new ArgumentException($\"radix {radix} is not supported\");    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;radix == 10&#8217; is always true. ScottPlot DecimalTickSpacingCalculator.cs 42<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>radix == 10<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u041d\u0435 \u043d\u0430\u0434\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u0445\u043e\u0434\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>radix<\/code> \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <code>radix == 10<\/code> \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 10.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u043d\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c \u043f\u0440\u0438 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u043e\u043a \u044d\u0442\u0430 \u043e\u043f\u0446\u0438\u044f \u043f\u0440\u043e\u043f\u0430\u043b\u0430. \u0421\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0438 \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0447\u0438\u0449\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h3>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 7<\/strong><\/p>\n<pre><code class=\"cs\">public void Apply(RenderPack rp, bool beforeLayout) {   ....    if (isPanning &amp; Math.Abs(newLimits.Max - oldRight) &lt; tickDelta \/ 2)   {     newRight = oldRight;     newLeft = oldLeft;   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3093\/\">V3093<\/a> The &#8216;&amp;&#8217; operator evaluates both operands. Perhaps a short-circuit &#8216;&amp;&amp;&#8217; operator should be used instead. ScottPlot SnapToTicksX.cs 94<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>&amp;<\/code> \u043d\u0430 <code>&amp;&amp;<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 <code>false<\/code>.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043a\u043e\u0443\u043f\u0435 (\u043f\u043e\u043b\u0435, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e). \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0435\u0442\u043e\u0434, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442, \u0430 \u043b\u0438\u0448\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 8<\/strong><\/p>\n<pre><code class=\"cs\">public class DraggableRows() : IMultiplotLayout {    readonly List&lt;float&gt; PlotHeights = [];    ....    float[] GetDividerPositions()   {     if (PlotHeights.Count == 1)       return [PlotHeights[0]];      float[] positions = new float[PlotHeights.Count - 1]; \/\/ &lt;=      positions[0] = PlotHeights[0];     for (int i = 1; i &lt; positions.Length; i++)     {       positions[i] = positions[i - 1] + PlotHeights[i];     }      return positions;   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3171\/\">V3171<\/a> The value used as the size of an array could reach -1. Consider inspecting: PlotHeights.Count &#8212; 1. ScottPlot DraggableRows.cs 42<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>positions<\/code>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>PlotHeights.Count - 1<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0447\u0442\u043e <code>PlotHeights.Count<\/code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 0. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <code>PlotHeights<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <strong>\u043d\u0435<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e <code>PlotHeights<\/code> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0435\u0439. \u042d\u0442\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<h3>\u041d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 9<\/strong><\/p>\n<pre><code class=\"cs\">private void RenderColorbarAxis(RenderPack rp,                                 PixelRect colormapRect,                                 float size,                                 float offset) {   GenerateTicks(rp.DataRect);    float size2 = Edge switch   {     Edge.Left =&gt; size - colormapRect.Width,     Edge.Right =&gt; size - colormapRect.Width,     Edge.Bottom =&gt; size - colormapRect.Height,     Edge.Top =&gt; size - colormapRect.Height,     _ =&gt; throw new NotImplementedException(),   };    float offset2 = Edge switch   {     Edge.Left =&gt; rp.DataRect.Left - colormapRect.Left,     Edge.Right =&gt; colormapRect.Right - rp.DataRect.Right,     Edge.Bottom =&gt; colormapRect.Bottom - rp.DataRect.Bottom,     Edge.Top =&gt; rp.DataRect.Top - colormapRect.Top,     _ =&gt; throw new NotImplementedException(),   };    Axis.Render(rp, size2, offset2); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3196\/\">V3196<\/a> The &#8216;offset&#8217; parameter is not utilized inside the method body, but an identifier with a similar name is used inside the same method. ScottPlot ColorBar.cs 133<\/p>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u043e \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u0435\u0435 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f. \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>offset<\/code>. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443), \u0447\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e.<\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>RenderColorbarAxis<\/code> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e <code>offset<\/code>, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<h3>\u0411\u0435\u0441\u043f\u043e\u0440\u044f\u0434\u043e\u043a<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 10<\/strong><\/p>\n<pre><code class=\"cs\">public Rectangle Rectangle(CoordinateRect rect) {   return Rectangle(rect.Left, rect.Right, rect.Top, rect.Bottom); }  public Rectangle Rectangle(double left, double right, double bottom, double top) {   Color color = GetNextColor();   Rectangle rp = new()   {     X1 = left,     X2 = right,     Y1 = bottom,     Y2 = top,     LineColor = color,     FillColor = color.WithAlpha(.5),   };    Plot.PlottableList.Add(rp);   return rp; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3066\/\">V3066<\/a> Possible incorrect order of arguments passed to &#8216;Rectangle&#8217; method: &#8216;rect.Top&#8217; and &#8216;rect.Bottom&#8217;. ScottPlot PlottableAdder.cs 1078<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043c\u0435\u0442\u043e\u0434 <code>Rectangle<\/code> \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d \u0438\u0445 \u043f\u043e\u0440\u044f\u0434\u043e\u043a. \u0418 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a: \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <code>rect.Top<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <code>bottom<\/code>, \u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <code>rect.Bottom<\/code> \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <code>top<\/code>.<\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u0437\u0434\u0435\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u0435\u0441\u0442\u044c, \u0442\u043e \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0439, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u0430\u043a\u0442 \u0435\u0451 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \ud83d\ude42<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b \u0447\u0438\u0441\u0442\u044b\u043c: \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 50 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u0436\u0435 \u0438\u0437 \u0438\u0445 \u0447\u0438\u0441\u043b\u0430 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c 10, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438. \u0410 \u0432\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1109\/\">\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>.<\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio, \u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1239\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Nikita Panevin. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/1239\/\">Graph mess: what does ScottPlot have in store?<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/892574\/\"> https:\/\/habr.com\/ru\/articles\/892574\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>ScottPlot \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434 .NET \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432. \u0418\u0437-\u0437\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u0445 \u043a\u043e\u0434 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u0443\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u043e\u0442\u044b\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0431\u043e \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 ScottPlot \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/scottplot.net\/\">\u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>. \u041d\u0430 \u043d\u0451\u043c \u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0433\u0440\u0430\u0444\u0438\u043a, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67dbc3208f844fa824832811\" data-style=\"\" id=\"67dbc3208f844fa824832811\" width=\"\"><\/div>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435, ScottPlot \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430. \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u0442\u043e\u0438\u0442 \u0443\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u0430. \u0412\u0435\u0434\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u043e \u0438 \u043d\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441 \u0435\u0451 \u043f\u043e\u043c\u043e\u0449\u044c\u044e. \u042d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c ScottPlot \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 <a href=\"https:\/\/pvs-studio.ru\">PVS-Studio<\/a>.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u0442\u043e\u043c\u0443 <a href=\"https:\/\/github.com\/ScottPlot\/ScottPlot\/tree\/fff3fca297c0e05c85e5dc19033504a3454605cf\">\u043a\u043e\u043c\u043c\u0438\u0442\u0443<\/a>.<\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442.<\/p>\n<h3>\u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u0444\u043e\u043a\u0443\u0441\u044b<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 1<\/strong><\/p>\n<pre><code class=\"cs\">public static Interactivity.Key GetKey(this Keys keys) {      Keys keyCode = keys &amp; ~Keys.Modifiers;                   \/\/ &lt;=   Interactivity.Key key = keyCode switch   {     Keys.Alt =&gt; Interactivity.StandardKeys.Alt,            \/\/ &lt;=     Keys.Menu =&gt; Interactivity.StandardKeys.Alt,     Keys.Shift =&gt; Interactivity.StandardKeys.Shift,        \/\/ &lt;=     Keys.ShiftKey =&gt; Interactivity.StandardKeys.Shift,     Keys.LShiftKey =&gt; Interactivity.StandardKeys.Shift,     Keys.RShiftKey =&gt; Interactivity.StandardKeys.Shift,     Keys.Control =&gt; Interactivity.StandardKeys.Control,    \/\/ &lt;=     Keys.ControlKey =&gt; Interactivity.StandardKeys.Control,     Keys.Down =&gt; Interactivity.StandardKeys.Down,     Keys.Up =&gt; Interactivity.StandardKeys.Up,     Keys.Left =&gt; Interactivity.StandardKeys.Left,     Keys.Right =&gt; Interactivity.StandardKeys.Right,     _ =&gt; Interactivity.StandardKeys.Unknown,   };    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3202\/\">V3202<\/a> Unreachable code detected. The &#8216;case&#8217; value is out of range of the match expression. ScottPlot.WinForms FormsPlotExtensions.cs 106<\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 <code>switch<\/code> \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0432 \u0447\u0451\u043c \u0442\u0443\u0442 \u0434\u0435\u043b\u043e.<\/p>\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 &#171;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u043c&#187; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"cs\">[Flags] [TypeConverter(typeof(KeysConverter))] [Editor(....)] public enum Keys {   \/\/\/ &lt;summary&gt;   \/\/\/  The bit mask to extract modifiers from a key value.   \/\/\/ &lt;\/summary&gt;   Modifiers = unchecked((int)0xFFFF0000),    ....   \/\/\/ &lt;summary&gt;   \/\/\/  The SHIFT modifier key.   \/\/\/ &lt;\/summary&gt;   Shift = 0x00010000,    \/\/\/ &lt;summary&gt;   \/\/\/  The  CTRL modifier key.   \/\/\/ &lt;\/summary&gt;   Control = 0x00020000,    \/\/\/ &lt;summary&gt;   \/\/\/  The ALT modifier key.   \/\/\/ &lt;\/summary&gt;   Alt = 0x00040000 } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u0438\u0445 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0418\u043c\u044f<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (10-\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430)<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0411\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (2-\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Modifiers<\/p>\n<\/td>\n<td>\n<p align=\"left\">0xFFFF0000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1111 1111 1111 1111 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Shift<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x00010000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0000 0000 0000 0001 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Control<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x00020000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0000 0000 0000 0010 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Alt<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x00040000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0000 0000 0000 0100 0000 0000 0000 0000<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e <code>Modifiers<\/code> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 &#171;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445&#187; \u0447\u043b\u0435\u043d\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0435 \u0432 <code>switch<\/code>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>keys &amp; ~Keys.Modifiers<\/code>. \u042d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0438\u0437 <code>keys<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>Keys.Modifiers<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u043c\u0438\u043c\u043e <code>Keys.Modifiers<\/code>, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u044b <code>Shift<\/code>, <code>Control<\/code> \u0438 <code>Alt<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a <code>Modifiers<\/code> \u0443\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u0438\u0442\u0430 &#171;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445&#187; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0443 <code>Modifiers<\/code> \u0435\u0441\u0442\u044c \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0431\u0438\u0442).<\/p>\n<p>\u0418\u0437 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0431\u0438\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <code>Shift<\/code>, <code>Control<\/code> \u0438\u043b\u0438 <code>Alt<\/code> \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <code>keys &amp; ~Keys.Modifiers<\/code>.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0430 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>switch<\/code>.<\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 2<\/strong><\/p>\n<pre><code class=\"cs\">internal double BackAngleSweep {   get   {     double maxBackAngle = CircularBackground ? 360 : MaximumSizeAngle;     if (!Clockwise) maxBackAngle = -maxBackAngle;     return maxBackAngle;   }    private set { BackAngleSweep = value; } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3110\/\">V3110<\/a> Possible infinite recursion inside &#8216;BackAngleSweep&#8217; property. ScottPlot RadialGauge.cs 45<\/p>\n<p>\u0412\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f setter&#8217;\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>BackAngleSweep<\/code>. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0433\u043b\u044f\u0434\u0435\u0442\u044c\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 setter&#8217;\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e \u0441\u0435\u0431\u0435. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f &#171;Stack Overflow&#187;.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u043d\u0435\u0442 \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e setter \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 <code>BackAngleSweep<\/code>, \u0442\u043e \u043d\u0435\u043c\u0438\u043d\u0443\u0435\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442 &#171;Stack Overflow&#187;.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 3<\/strong><\/p>\n<pre><code class=\"cs\">public bool Rounded {     get =&gt; StrokeCap == SKStrokeCap.Round;     set { StrokeCap = SKStrokeCap.Round; StrokeJoin = SKStrokeJoin.Round; } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3077\/\">V3077<\/a> The setter of &#8216;Rounded&#8217; property does not utilize its &#8216;value&#8217; parameter. ScottPlot LineStyle.cs 36<\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0442\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 setter&#8217;\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u041f\u0440\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0438 \u0435\u043c\u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e. \u0412\u0441\u0451 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0438 \u0432 <code>value<\/code>, \u043d\u0438 \u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e \u0435\u0449\u0451.<\/p>\n<h3>\u0421\u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c?<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 4<\/strong><\/p>\n<pre><code class=\"cs\">public class CoordinateRangeMutable : IEquatable&lt;CoordinateRangeMutable&gt; {   ....   public bool Equals(CoordinateRangeMutable? other)   {     if (other is null)       return false;      return Equals(Min, other.Min) &amp;&amp; Equals(Min, other.Min);  \/\/ &lt;=   }    public override bool Equals(object? obj)   {     if (obj is null)       return false;      if (obj is CoordinateRangeMutable other)       return Equals(other);      return false;   }    public override int GetHashCode()   {     return Min.GetHashCode() ^ Max.GetHashCode();             \/\/ &lt;=   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3192\/\">V3192<\/a> The &#8216;Max&#8217; property is used in the &#8216;GetHashCode&#8217; method but is missing from the &#8216;Equals&#8217; method. ScottPlot CoordinateRangeMutable.cs 198<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3001\/\">V3001<\/a> There are identical sub-expressions &#8216;Equals(Min, other.Min)&#8217; to the left and to the right of the &#8216;&amp;&amp;&#8217; operator. ScottPlot CoordinateRangeMutable.cs 172<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3192\/\">V3192<\/a>. \u0412 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Max<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>GetHashCode<\/code>, \u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>Equals<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>Equals<\/code>, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0435\u0433\u043e \u0442\u0435\u043b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u0438\u043d <code>Equals<\/code>. \u0412 \u043d\u0451\u043c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c: <code>Equals(Min, other.Min) &amp;&amp; Equals(Min, other.Min)<\/code>. \u0410 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0443\u043a\u0430\u0437\u0430\u043b\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3001\/\">V3001<\/a>.<\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 <code>&amp;&amp;<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434: <code>Equals(Max, other.Max)<\/code>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0430\u0432, \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>Equals<\/code> \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442 <code>Max<\/code>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 5<\/strong><\/p>\n<pre><code class=\"cs\">public class CoordinateRangeMutable : IEquatable&lt;CoordinateRangeMutable&gt; {   ....   public static bool operator ==(CoordinateRangeMutable a,                                   CoordinateRangeMutable b)   {     return a.Equals(b);   }    public static bool operator !=(CoordinateRangeMutable a,                                   CoordinateRangeMutable b)   {     return !a.Equals(b);   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;==&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ScottPlot CoordinateRangeMutable.cs 188<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;!=&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ScottPlot CoordinateRangeMutable.cs 193<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>CoordinateRangeMutable<\/code>. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>==<\/code> \u0438 <code>!=<\/code> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <code>NullReferenceException<\/code>. \u0418 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a: \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 <code>CoordinateRangeMutable<\/code> \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0431\u0443\u0434\u0435\u0442 <code>null<\/code>, \u0442\u043e \u043c\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c <code>NullReferenceException<\/code>.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>Equals<\/code> \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <code>null<\/code>.<\/p>\n<h3>\u0412\u0441\u0435\u0433\u0434\u0430 \u0434\u0430<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 6<\/strong><\/p>\n<pre><code class=\"cs\">private double GetIdealTickSpacing(CoordinateRange range,                                    PixelLength axisLength,                                    PixelLength maxLabelLength) {   int targetTickCount = (int)(axisLength.Length \/ maxLabelLength.Length) + 1;    int radix = 10;                                          \/\/ &lt;=   int exponent = (int)Math.Log(range.Length, radix) + 1;   double initialSpace = Math.Pow(radix, exponent);   List&lt;double&gt; tickSpacings = [initialSpace];    double[] divBy;   if (radix == 10)                                         \/\/ &lt;=     divBy = [2, 2, 2.5]; \/\/ 10, 5, 2.5, 1   else if (radix == 16)     divBy = [2, 2, 2, 2]; \/\/ 16, 8, 4, 2, 1   else     throw new ArgumentException($\"radix {radix} is not supported\");    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;radix == 10&#8217; is always true. ScottPlot DecimalTickSpacingCalculator.cs 42<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>radix == 10<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u041d\u0435 \u043d\u0430\u0434\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u0445\u043e\u0434\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>radix<\/code> \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <code>radix == 10<\/code> \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 10.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u043d\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c \u043f\u0440\u0438 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u043e\u043a \u044d\u0442\u0430 \u043e\u043f\u0446\u0438\u044f \u043f\u0440\u043e\u043f\u0430\u043b\u0430. \u0421\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0438 \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0447\u0438\u0449\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h3>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 7<\/strong><\/p>\n<pre><code class=\"cs\">public void Apply(RenderPack rp, bool beforeLayout) {   ....    if (isPanning &amp; Math.Abs(newLimits.Max - oldRight) &lt; tickDelta \/ 2)   {     newRight = oldRight;     newLeft = oldLeft;   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3093\/\">V3093<\/a> The &#8216;&amp;&#8217; operator evaluates both operands. Perhaps a short-circuit &#8216;&amp;&amp;&#8217; operator should be used instead. ScottPlot SnapToTicksX.cs 94<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>&amp;<\/code> \u043d\u0430 <code>&amp;&amp;<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 <code>false<\/code>.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043a\u043e\u0443\u043f\u0435 (\u043f\u043e\u043b\u0435, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e). \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0435\u0442\u043e\u0434, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442, \u0430 \u043b\u0438\u0448\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440<\/h3>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 8<\/strong><\/p>\n<pre><code class=\"cs\">public class <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-452440","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/452440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=452440"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/452440\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=452440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=452440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=452440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}