KiCad PCB EDA Suite
sch_sheet.cpp File Reference
#include <bitmaps.h>
#include <core/mirror.h>
#include <sch_draw_panel.h>
#include <gr_text.h>
#include <trigo.h>
#include <sch_edit_frame.h>
#include <plotter.h>
#include <kicad_string.h>
#include <widgets/msgpanel.h>
#include <math/util.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <sch_sheet_pin.h>
#include <sch_symbol.h>
#include <sch_painter.h>
#include <schematic.h>
#include <settings/color_settings.h>
#include <trace_helpers.h>
#include <pgm_base.h>
#include <wx/log.h>

Go to the source code of this file.

Functions

int bumpToNextGrid (const int aVal, const int aDirection)
 

Function Documentation

◆ bumpToNextGrid()

int bumpToNextGrid ( const int  aVal,
const int  aDirection 
)

Definition at line 396 of file sch_sheet.cpp.

397 {
398  constexpr int gridSize = Mils2iu( 50 );
399 
400  return ( KiROUND( aVal / gridSize ) * gridSize ) + ( aDirection * gridSize );
401 }
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:70

References KiROUND().

Referenced by SCH_SHEET::GetMinHeight(), and SCH_SHEET::GetMinWidth().