~cern-kicad/kicad/kicad-pns-tom

« back to all changes in this revision

Viewing changes to pcbnew/printout_controler.cpp

More int casts to rounding conversions

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
                scalex, scaley );
251
251
 
252
252
    wxSize PlotAreaSizeInUserUnits;
253
 
    PlotAreaSizeInUserUnits.x = (int) (PlotAreaSizeInPixels.x/scalex);
254
 
    PlotAreaSizeInUserUnits.y = (int) (PlotAreaSizeInPixels.y/scaley);
 
253
    PlotAreaSizeInUserUnits.x = KiROUND( PlotAreaSizeInPixels.x / scalex );
 
254
    PlotAreaSizeInUserUnits.y = KiROUND( PlotAreaSizeInPixels.y / scaley );
255
255
    wxLogTrace( tracePrinting, wxT( "Scaled plot area in user units:   x=%d, y=%d" ),
256
256
                PlotAreaSizeInUserUnits.x, PlotAreaSizeInUserUnits.y );
257
257
 
309
309
         * (this is the upper left corner) but the Y axis is reversed, therefore the plotting area
310
310
         * is the y coordinate values from  - PlotAreaSize.y to 0 */
311
311
        int y_dc_offset = PlotAreaSizeInPixels.y;
312
 
        y_dc_offset = (int) ( ( double ) y_dc_offset * userscale );
 
312
        y_dc_offset = KiROUND( y_dc_offset  * userscale );
313
313
        dc->SetDeviceOrigin( 0, y_dc_offset );
314
314
 
315
315
        wxLogTrace( tracePrinting, wxT( "Device origin:                    x=%d, y=%d" ),