title: Bearing range issue for 360 degree angles
body: <p>So I'm calculating my bearings on a gui based on incoming degrees and everything works fine. Except now I'm trying to show an view range around that incoming bearing.</p>
  
  <p>For example, the incoming bearing is 0 degrees, and my +/- view radius is 16 degrees.</p>
  
  <p>Therefore at 0 my min view range goes "down" to 344, and my max goes up to 16.</p>
  
  <p>Each degree I have a QGraphicsLineItem that I am coloring based on where it falls within this range; it has an associated degree angle for where it is currently placed. So if the item is not within the current range it is red, if it is then its blue.</p>
  
  <p>My issue lies with trying to figure out the logical condition to check against.</p>
  
  <p>Currently I have:</p>
  
  <pre><code>if(item.degrees &lt;= minViewRange &amp;&amp; item.degrees &lt;= bearing )
      item.colorBlue = true;
  else if (item.degrees &gt;= bearing &amp;&amp; item.degrees &lt;= maxViewRange)
      item.colorBlue = true;
  else
      item.colorBlue = false;
  </code></pre>
  
  <p>All of this works fine until I get within 16 degrees of zero.</p>
  
  <p>So for example, at a bearing of 0, only the (0 - 16)  condition is true, so only that half gets colored. (344 - 0) isn't true because 344 isn't less than 0.</p>
  
  <p>Once bearing becomes 16, then my ranges get colored correctly again because then ( 0 &lt; 16 &lt; 32)</p>
  
  <p>How can I compensate for this?</p>