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:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user