Sim plot: fix a rounding issue that can create a missing point in a plot.

Due to a truncation when converting a value to integer, the first point was
sometimes missing because it looked like out of plot range.
Fix also a cosmetic issue in dialog.
Fixes #7345
https://gitlab.com/kicad/code/kicad/issues/7345
This commit is contained in:
jean-pierre charras
2021-01-31 10:36:26 +01:00
parent 8eca23aabe
commit c155218582
5 changed files with 10 additions and 38 deletions
+3 -1
View File
@@ -708,7 +708,9 @@ void mpFXY::Plot( wxDC& dc, mpWindow& w )
wxCoord y1 = w.y2p( py );
// Store only points on the drawing area, to speed up the drawing time
if( x1 >= startPx && x1 <= endPx )
// Note: x1 is a value truncated from px by w.x2p(). So to be sure the
// first point is drawn, the x1 low limit is startPx-1 in plot coordinates
if( x1 >= startPx-1 && x1 <= endPx )
{
if( !count || line_start.x != x1 )
{