Agreed, it should use '||'.

The fix is committed

--
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.

________________________________________
From: Kamil Ignacak <kamil.igna...@gmail.com>
Sent: 23 September 2018 19:25
To: viking-devel
Subject: [Viking-devel] Comparing coordinates in trw layer code

Hi,

I've been looking at trw code and I noticed one possible problem in code
drawing track. Can you please take a look?

The problem is with this code in viktrwlayer.c (~line 2452):

/*
 * If points are the same in display coordinates, don't draw.
 */
if ( x != oldx &amp;&amp; y != oldy )
    {
      vik_viewport_coord_to_screen ( dp-&gt;vp, &amp;(tp2-&gt;coord), &amp;x, 
&amp;y );
      draw_utm_skip_insignia ( dp-&gt;vp, main_gc, x, y );
    }

Shouldn't the condition be rather "x != oldx || y != oldy"? Similar block of 
code is present few lines above, but the condition contains "||" instead of 
"&amp;&amp;":

/*
 * If points are the same in display coordinates, don't draw.
 */
if ( x != oldx || y != oldy )
    {
      if ( draw_track_outline )
        vik_viewport_draw_line ( dp-&gt;vp, dp-&gt;vtl-&gt;track_bg_gc, oldx, 
oldy, x, y);
      else
        vik_viewport_draw_line ( dp-&gt;vp, main_gc, oldx, oldy, x, y);
    }


Best regards,
Kamil
</kamil.igna...@gmail.com>

_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to