diff --git a/common/drawing_sheet/ds_data_item.cpp b/common/drawing_sheet/ds_data_item.cpp index d7e6fa847f..630473438a 100644 --- a/common/drawing_sheet/ds_data_item.cpp +++ b/common/drawing_sheet/ds_data_item.cpp @@ -296,8 +296,7 @@ const VECTOR2D DS_DATA_ITEM::GetStartPos( int ii ) const const VECTOR2I DS_DATA_ITEM::GetStartPosIU( int ii ) const { - VECTOR2D pos = GetStartPos( ii ) * DS_DATA_MODEL::GetTheInstance().m_WSunits2Iu; - return VECTOR2I( KiROUND( pos.x ), KiROUND( pos.y ) ); + return KiROUND( GetStartPos( ii ) * DS_DATA_MODEL::GetTheInstance().m_WSunits2Iu ); } diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index a7700aff9f..44ead2f5ce 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -1025,7 +1025,7 @@ VECTOR2I EDA_DRAW_FRAME::GetNearestGridPosition( const VECTOR2I& aPosition ) con double yOffset = fmod( gridOrigin.y, gridSize.y ); int y = KiROUND( (aPosition.y - yOffset) / gridSize.y ); - return VECTOR2I( KiROUND( x * gridSize.x + xOffset ), KiROUND( y * gridSize.y + yOffset ) ); + return KiROUND( x * gridSize.x + xOffset, y * gridSize.y + yOffset ); } @@ -1039,7 +1039,7 @@ VECTOR2I EDA_DRAW_FRAME::GetNearestHalfGridPosition( const VECTOR2I& aPosition ) double yOffset = fmod( gridOrigin.y, gridSize.y ); int y = KiROUND( (aPosition.y - yOffset) / gridSize.y ); - return VECTOR2I( KiROUND( x * gridSize.x + xOffset ), KiROUND( y * gridSize.y + yOffset ) ); + return KiROUND( x * gridSize.x + xOffset, y * gridSize.y + yOffset ); } diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 1aead7b1fd..c19c92e97c 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -2507,8 +2507,8 @@ void PDF_PLOTTER::drawOverbars( const std::vector& aOverbars, cons endPt.x -= dir.x * barTrim - offVec.x; // subtract trim, then apply same vertical offset endPt.y -= dir.y * barTrim - offVec.y; - VECTOR2I iStart( KiROUND( startPt.x ), KiROUND( startPt.y ) ); - VECTOR2I iEnd( KiROUND( endPt.x ), KiROUND( endPt.y ) ); + VECTOR2I iStart = KiROUND( startPt.x, startPt.y ); + VECTOR2I iEnd = KiROUND( endPt.x, endPt.y ); MoveTo( iStart ); LineTo( iEnd ); diff --git a/common/preview_items/polygon_geom_manager.cpp b/common/preview_items/polygon_geom_manager.cpp index e487e74db2..e91ceb88d3 100644 --- a/common/preview_items/polygon_geom_manager.cpp +++ b/common/preview_items/polygon_geom_manager.cpp @@ -223,7 +223,7 @@ static SHAPE_LINE_CHAIN build45DegLeader( const VECTOR2I& aEndPoint, const SHAPE } } - const VECTOR2I midInt = { KiROUND( mid.x ), KiROUND( mid.y ) }; + const VECTOR2I midInt = KiROUND( mid.x, mid.y ); return SHAPE_LINE_CHAIN( std::vector{ lastPt, midInt, aEndPoint } ); } diff --git a/common/stroke_params.cpp b/common/stroke_params.cpp index d8b5e8a8ff..e6e7717773 100644 --- a/common/stroke_params.cpp +++ b/common/stroke_params.cpp @@ -143,7 +143,7 @@ void STROKE_PARAMS::Stroke( const SHAPE* aShape, LINE_STYLE aLineStyle, int aWid VECTOR2D start = line->GetSeg().A; VECTOR2D end = line->GetSeg().B; - BOX2I clip( start, VECTOR2I( KiROUND( end.x - start.x ), KiROUND( end.y - start.y ) ) ); + BOX2I clip( start, KiROUND( end.x - start.x, end.y - start.y ) ); clip.Normalize(); double theta = atan2( end.y - start.y, end.x - start.x ); @@ -156,8 +156,8 @@ void STROKE_PARAMS::Stroke( const SHAPE* aShape, LINE_STYLE aLineStyle, int aWid start.y + strokes[ i % wrapAround ] * sin( theta ) ); // Drawing each segment can be done rounded to ints. - VECTOR2I a( KiROUND( start.x ), KiROUND( start.y ) ); - VECTOR2I b( KiROUND( next.x ), KiROUND( next.y ) ); + VECTOR2I a = KiROUND( start ); + VECTOR2I b = KiROUND( next ); if( ClipLine( &clip, a.x, a.y, b.x, b.y ) ) break; diff --git a/common/tool/construction_manager.cpp b/common/tool/construction_manager.cpp index d1ff8711bc..8894fd24ed 100644 --- a/common/tool/construction_manager.cpp +++ b/common/tool/construction_manager.cpp @@ -725,7 +725,7 @@ OPT_VECTOR2I SNAP_LINE_MANAGER::GetNearestSnapLinePoint( const VECTOR2I& aCur if( perpDistance < bestPerpDistance ) { bestPerpDistance = perpDistance; - bestSnapPoint = VECTOR2I( KiROUND( snapPoint.x ), KiROUND( snapPoint.y ) ); + bestSnapPoint = KiROUND( snapPoint ); wxLogTrace( traceSnap, " NEW BEST: perpDist=%.1f, snapPoint=(%d, %d)", bestPerpDistance, bestSnapPoint->x, bestSnapPoint->y ); } diff --git a/common/tool/edit_constraints.cpp b/common/tool/edit_constraints.cpp index 7fe192d2df..5080b2d5be 100644 --- a/common/tool/edit_constraints.cpp +++ b/common/tool/edit_constraints.cpp @@ -208,7 +208,7 @@ void EC_CONVERGING::Apply( EDIT_LINE& aHandle, const GRID_HELPER& aGrid ) t = 0.0; VECTOR2D newCenterD = VECTOR2D( m_convergencePoint ) + VECTOR2D( m_midVector ) * t; - VECTOR2I newCenter( KiROUND( newCenterD.x ), KiROUND( newCenterD.y ) ); + VECTOR2I newCenter = KiROUND( newCenterD ); aHandle.SetPosition( newCenter ); // The dragged segment endpoints diff --git a/common/tool/grid_helper.cpp b/common/tool/grid_helper.cpp index da10e4a68b..34f4446945 100644 --- a/common/tool/grid_helper.cpp +++ b/common/tool/grid_helper.cpp @@ -307,7 +307,7 @@ std::optional GRID_HELPER::SnapToConstructionLines( const VECTOR2I& aP candidate.x, candidate.y ); } - VECTOR2I candidateInt( KiROUND( candidate.x ), KiROUND( candidate.y ) ); + VECTOR2I candidateInt = KiROUND( candidate ); if( candidateInt == m_skipPoint ) { diff --git a/eeschema/import_gfx/graphics_importer_lib_symbol.cpp b/eeschema/import_gfx/graphics_importer_lib_symbol.cpp index 3448fa8fe9..a4be67bde4 100644 --- a/eeschema/import_gfx/graphics_importer_lib_symbol.cpp +++ b/eeschema/import_gfx/graphics_importer_lib_symbol.cpp @@ -45,7 +45,7 @@ VECTOR2I GRAPHICS_IMPORTER_LIB_SYMBOL::MapCoordinate( const VECTOR2D& aCoordinat coord += GetImportOffsetMM(); coord *= GetMillimeterToIuFactor(); - return VECTOR2I( KiROUND( coord.x ), KiROUND( coord.y ) ); + return KiROUND( coord ); } diff --git a/eeschema/import_gfx/graphics_importer_sch.cpp b/eeschema/import_gfx/graphics_importer_sch.cpp index a5400a03a5..e90bede1ea 100644 --- a/eeschema/import_gfx/graphics_importer_sch.cpp +++ b/eeschema/import_gfx/graphics_importer_sch.cpp @@ -46,7 +46,7 @@ VECTOR2I GRAPHICS_IMPORTER_SCH::MapCoordinate( const VECTOR2D& aCoordinate ) coord += GetImportOffsetMM(); coord *= GetMillimeterToIuFactor(); - return VECTOR2I( KiROUND( coord.x ), KiROUND( coord.y ) ); + return KiROUND( coord ); } diff --git a/eeschema/sch_io/altium/sch_io_altium.cpp b/eeschema/sch_io/altium/sch_io_altium.cpp index 34fb230252..ae2c6f346d 100644 --- a/eeschema/sch_io/altium/sch_io_altium.cpp +++ b/eeschema/sch_io/altium/sch_io_altium.cpp @@ -2506,10 +2506,8 @@ void SCH_IO_ALTIUM::ParseArc( const std::map& aProperties, VECTOR2I center = elem.m_Center; EDA_ANGLE startAngle( elem.m_EndAngle, DEGREES_T ); EDA_ANGLE endAngle( elem.m_StartAngle, DEGREES_T ); - VECTOR2I startOffset( KiROUND( arc_radius * startAngle.Cos() ), - -KiROUND( arc_radius * startAngle.Sin() ) ); - VECTOR2I endOffset( KiROUND( arc_radius * endAngle.Cos() ), - -KiROUND( arc_radius * endAngle.Sin() ) ); + VECTOR2I startOffset = KiROUND( arc_radius * startAngle.Cos(), -( arc_radius * startAngle.Sin() ) ); + VECTOR2I endOffset = KiROUND( arc_radius * endAngle.Cos(), -( arc_radius * endAngle.Sin() ) ); if( aSymbol.empty() && ShouldPutItemOnSheet( elem.ownerindex ) ) { @@ -2715,10 +2713,8 @@ void SCH_IO_ALTIUM::ParsePieChart( const std::map& aProperti VECTOR2I center = elem.m_Center; EDA_ANGLE startAngle( elem.m_EndAngle, DEGREES_T ); EDA_ANGLE endAngle( elem.m_StartAngle, DEGREES_T ); - VECTOR2I startOffset( KiROUND( arc_radius * startAngle.Cos() ), - -KiROUND( arc_radius * startAngle.Sin() ) ); - VECTOR2I endOffset( KiROUND( arc_radius * endAngle.Cos() ), - -KiROUND( arc_radius * endAngle.Sin() ) ); + VECTOR2I startOffset = KiROUND( arc_radius * startAngle.Cos(), -( arc_radius * startAngle.Sin() ) ); + VECTOR2I endOffset = KiROUND( arc_radius * endAngle.Cos(), -( arc_radius * endAngle.Sin() ) ); if( aSymbol.empty() && ShouldPutItemOnSheet( elem.ownerindex ) ) { diff --git a/eeschema/sch_io/eagle/sch_io_eagle.cpp b/eeschema/sch_io/eagle/sch_io_eagle.cpp index 3be2533fcc..3e6cc55368 100644 --- a/eeschema/sch_io/eagle/sch_io_eagle.cpp +++ b/eeschema/sch_io/eagle/sch_io_eagle.cpp @@ -1621,8 +1621,7 @@ SCH_TEXT* SCH_IO_EAGLE::loadLabel( const std::unique_ptr& aLabel, bool global = m_netCounts[aNetName] > 1; std::unique_ptr label; - VECTOR2I textSize = VECTOR2I( KiROUND( aLabel->size.ToSchUnits() * 0.7 ), - KiROUND( aLabel->size.ToSchUnits() * 0.7 ) ); + VECTOR2I textSize = KiROUND( aLabel->size.ToSchUnits() * 0.7, aLabel->size.ToSchUnits() * 0.7 ); if( m_modules.size() ) { diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 719b154740..fb6d079703 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -3585,8 +3585,8 @@ void SCH_PAINTER::draw( const SCH_GROUP* aGroup, int aLayer ) // Scale by zoom a bit, but not too much int textSize = ( scaledSize + ( unscaledSize * 2 ) ) / 3; - VECTOR2I textOffset = VECTOR2I( width.x / 2, -KiROUND( textSize * 0.5 ) ); - VECTOR2I titleHeight = VECTOR2I( 0, KiROUND( textSize * 2.0 ) ); + VECTOR2I textOffset = KiROUND( width.x / 2.0, -textSize * 0.5 ); + VECTOR2I titleHeight = KiROUND( 0.0, textSize * 2.0 ); if( PrintableCharCount( name ) * textSize < bbox.GetWidth() ) { diff --git a/libs/kimath/src/geometry/seg.cpp b/libs/kimath/src/geometry/seg.cpp index 1d09d0eb69..cf34e6cc6d 100644 --- a/libs/kimath/src/geometry/seg.cpp +++ b/libs/kimath/src/geometry/seg.cpp @@ -504,10 +504,7 @@ bool SEG::IntersectsLine( double aSlope, double aOffset, VECTOR2I& aIntersection // Check if intersection is within segment bounds if( t >= 0.0 && t <= 1.0 ) { - const double intersect_x = segA.x + t * segDir.x; - const double intersect_y = segA.y + t * segDir.y; - - aIntersection = VECTOR2I( KiROUND( intersect_x ), KiROUND( intersect_y ) ); + aIntersection = KiROUND( segA.x + t * segDir.x, segA.y + t * segDir.y ); return true; } diff --git a/libs/kimath/src/geometry/shape_arc.cpp b/libs/kimath/src/geometry/shape_arc.cpp index c0609c9f6d..ac0ae7dc36 100644 --- a/libs/kimath/src/geometry/shape_arc.cpp +++ b/libs/kimath/src/geometry/shape_arc.cpp @@ -56,8 +56,8 @@ SHAPE_ARC::SHAPE_ARC( const VECTOR2I& aArcCenter, const VECTOR2I& aArcStartPoint RotatePoint( mid, center, -aCenterAngle / 2.0 ); RotatePoint( end, center, -aCenterAngle ); - m_mid = VECTOR2I( KiROUND( mid.x ), KiROUND( mid.y ) ); - m_end = VECTOR2I( KiROUND( end.x ), KiROUND( end.y ) ); + m_mid = KiROUND( mid ); + m_end = KiROUND( end ); update_values(); } diff --git a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp index 84432b1994..06edded314 100644 --- a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp +++ b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp @@ -177,27 +177,23 @@ static bool commonParallelProjection( const PCB_ARC& p, const PCB_ARC& n, SHAPE_ if( p_is_ccw ) { - p_clip_point = p_center + VECTOR2I( KiROUND( p_radius * clip_start_angle.Cos() ), - KiROUND( p_radius * clip_start_angle.Sin() ) ); + p_clip_point = p_center + KiROUND( p_radius * clip_start_angle.Cos(), p_radius * clip_start_angle.Sin() ); pClip = SHAPE_ARC( p_center, p_clip_point, clip_total_angle ); } else { - p_clip_point = p_center + VECTOR2I( KiROUND( p_radius * clip_end_angle.Cos() ), - KiROUND( p_radius * clip_end_angle.Sin() ) ); + p_clip_point = p_center + KiROUND( p_radius * clip_end_angle.Cos(), p_radius * clip_end_angle.Sin() ); pClip = SHAPE_ARC( p_center, p_clip_point, -clip_total_angle ); } if( n_is_ccw ) { - n_clip_point = n_center + VECTOR2I( KiROUND( n_radius * clip_start_angle.Cos() ), - KiROUND( n_radius * clip_start_angle.Sin() ) ); + n_clip_point = n_center + KiROUND( n_radius * clip_start_angle.Cos(), n_radius * clip_start_angle.Sin() ); nClip = SHAPE_ARC( n_center, n_clip_point, clip_total_angle ); } else { - n_clip_point = n_center + VECTOR2I( KiROUND( n_radius * clip_end_angle.Cos() ), - KiROUND( n_radius * clip_end_angle.Sin() ) ); + n_clip_point = n_center + KiROUND( n_radius * clip_end_angle.Cos(), n_radius * clip_end_angle.Sin() ); nClip = SHAPE_ARC( n_center, n_clip_point, -clip_total_angle ); } diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index 6c8bf7401e..3f375c2c1c 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -316,7 +316,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_ TEXT_ATTRIBUTES attrs; attrs.m_StrokeWidth = TextWidth; attrs.m_Angle = ANGLE_HORIZONTAL; - attrs.m_Size = VECTOR2I( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ); + attrs.m_Size = KiROUND( charSize * charScale, charSize * charScale ); attrs.m_Halign = GR_TEXT_H_ALIGN_LEFT; attrs.m_Valign = GR_TEXT_V_ALIGN_CENTER; attrs.m_Multiline = false; diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index d991da4735..5ac8ca02ae 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -169,7 +169,7 @@ void TUNING_STATUS_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const TEXT_ATTRIBUTES textAttrs; int glyphWidth = textDims.GlyphSize.x; - VECTOR2I margin( KiROUND( glyphWidth * 0.4 ), KiROUND( glyphWidth ) ); + VECTOR2I margin( KiROUND( glyphWidth * 0.4 ), glyphWidth ); VECTOR2I size( glyphWidth * 25 + margin.x * 2, headerDims.GlyphSize.y + textDims.GlyphSize.y ); VECTOR2I offset( margin.x * 2, -( size.y + margin.y * 2 ) ); diff --git a/pcbnew/import_gfx/graphics_importer_pcbnew.cpp b/pcbnew/import_gfx/graphics_importer_pcbnew.cpp index cd2add2d34..9561a45c15 100644 --- a/pcbnew/import_gfx/graphics_importer_pcbnew.cpp +++ b/pcbnew/import_gfx/graphics_importer_pcbnew.cpp @@ -48,7 +48,7 @@ VECTOR2I GRAPHICS_IMPORTER_PCBNEW::MapCoordinate( const VECTOR2D& aCoordinate ) coord += GetImportOffsetMM(); coord *= GetMillimeterToIuFactor(); - return VECTOR2I( KiROUND( coord.x ), KiROUND( coord.y ) ); + return KiROUND( coord.x, coord.y ); } diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index 960a07ac4a..f189ae582a 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -102,11 +102,11 @@ void HelperShapeLineChainFromAltiumVertices( SHAPE_LINE_CHAIN& aLine, double startradiant = DEG2RAD( vertex.startangle ); double endradiant = DEG2RAD( vertex.endangle ); - VECTOR2I arcStartOffset = VECTOR2I( KiROUND( std::cos( startradiant ) * vertex.radius ), - -KiROUND( std::sin( startradiant ) * vertex.radius ) ); + VECTOR2I arcStartOffset = KiROUND( std::cos( startradiant ) * vertex.radius, + -std::sin( startradiant ) * vertex.radius ); - VECTOR2I arcEndOffset = VECTOR2I( KiROUND( std::cos( endradiant ) * vertex.radius ), - -KiROUND( std::sin( endradiant ) * vertex.radius ) ); + VECTOR2I arcEndOffset = KiROUND( std::cos( endradiant ) * vertex.radius, + -std::sin( endradiant ) * vertex.radius ); VECTOR2I arcStart = vertex.center + arcStartOffset; VECTOR2I arcEnd = vertex.center + arcEndOffset; @@ -1822,7 +1822,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem ) if( dirVec.x != 0 || dirVec.y != 0 ) { double scaling = (double) dirVec.EuclideanNorm() / aElem.arrowsize; - VECTOR2I arrVec = VECTOR2I( KiROUND( dirVec.x / scaling ), KiROUND( dirVec.y / scaling ) ); + VECTOR2I arrVec = KiROUND( dirVec.x / scaling, dirVec.y / scaling ); RotatePoint( arrVec, EDA_ANGLE( 20.0, DEGREES_T ) ); { diff --git a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp index b8c27eac76..38d1a76da3 100644 --- a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp +++ b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp @@ -2043,7 +2043,7 @@ void PCB_IO_EAGLE::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree ) double annulus = drillz * m_rules->rvPadTop; // copper annulus, eagle "restring" annulus = eagleClamp( m_rules->rlMinPadTop, annulus, m_rules->rlMaxPadTop ); int diameter = KiROUND( drillz + 2 * annulus ); - pad->SetSize( PADSTACK::ALL_LAYERS, VECTOR2I( KiROUND( diameter ), KiROUND( diameter ) ) ); + pad->SetSize( PADSTACK::ALL_LAYERS, VECTOR2I( diameter, diameter ) ); } if( pad->GetShape( PADSTACK::ALL_LAYERS ) == PAD_SHAPE::OVAL ) diff --git a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp index f5c6388da3..58bc98ca00 100644 --- a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp +++ b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp @@ -1166,8 +1166,8 @@ FABMASTER::GRAPHIC_ARC* FABMASTER::processCircle( const GRAPHIC_DATA& aData, dou KiROUND( readDouble( aData.graphic_data1 ) * aScale ), -KiROUND( readDouble( aData.graphic_data2 ) * aScale ), }; - const VECTOR2I size{ KiROUND( readDouble( aData.graphic_data3 ) * aScale ), - KiROUND( readDouble( aData.graphic_data4 ) * aScale ) }; + const VECTOR2I size = KiROUND( readDouble( aData.graphic_data3 ) * aScale, + readDouble( aData.graphic_data4 ) * aScale ); if( size.x != size.y ) { diff --git a/pcbnew/pcb_io/pcad/pcad2kicad_common.cpp b/pcbnew/pcb_io/pcad/pcad2kicad_common.cpp index 85e061bdc9..6457335f0f 100644 --- a/pcbnew/pcb_io/pcad/pcad2kicad_common.cpp +++ b/pcbnew/pcb_io/pcad/pcad2kicad_common.cpp @@ -543,15 +543,13 @@ void CorrectTextPosition( TTEXTVALUE* aValue ) void SetTextSizeFromStrokeFontHeight( EDA_TEXT* aText, int aTextHeight ) { - aText->SetTextSize( VECTOR2I( KiROUND( aTextHeight * STROKE_WIDTH_TO_SIZE ), - KiROUND( aTextHeight * STROKE_HEIGHT_TO_SIZE ) ) ); + aText->SetTextSize( KiROUND( aTextHeight * STROKE_WIDTH_TO_SIZE, aTextHeight * STROKE_HEIGHT_TO_SIZE ) ); } void SetTextSizeFromTrueTypeFontHeight( EDA_TEXT* aText, int aTextHeight ) { - aText->SetTextSize( VECTOR2I( KiROUND( aTextHeight * TRUETYPE_WIDTH_TO_SIZE ), - KiROUND( aTextHeight * TRUETYPE_HEIGHT_TO_SIZE ) ) ); + aText->SetTextSize( KiROUND( aTextHeight * TRUETYPE_WIDTH_TO_SIZE, aTextHeight * TRUETYPE_HEIGHT_TO_SIZE ) ); } diff --git a/pcbnew/pcb_io/pcad/pcad_polygon.cpp b/pcbnew/pcb_io/pcad/pcad_polygon.cpp index df72b2967e..8f1baa1509 100644 --- a/pcbnew/pcb_io/pcad/pcad_polygon.cpp +++ b/pcbnew/pcb_io/pcad/pcad_polygon.cpp @@ -188,8 +188,7 @@ void PCAD_POLYGON::AddToBoard( FOOTPRINT* aFootprint ) // add outline for( int i = 0; i < (int) m_Outline.GetCount(); i++ ) { - zone->AppendCorner( VECTOR2I( KiROUND( m_Outline[i]->x ), - KiROUND( m_Outline[i]->y ) ), -1 ); + zone->AppendCorner( KiROUND( m_Outline[i]->x, m_Outline[i]->y ), -1 ); } zone->SetLocalClearance( m_Width ); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index d53916d9e4..42dbfa91a8 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -2765,8 +2765,8 @@ void PCB_PAINTER::draw( const PCB_GROUP* aGroup, int aLayer ) // Scale by zoom a bit, but not too much int textSize = ( scaledSize + ( unscaledSize * 2 ) ) / 3; - VECTOR2I textOffset = VECTOR2I( width.x / 2, -KiROUND( textSize * 0.5 ) ); - VECTOR2I titleHeight = VECTOR2I( 0, KiROUND( textSize * 2.0 ) ); + VECTOR2I textOffset = KiROUND( width.x / 2.0, -textSize * 0.5 ); + VECTOR2I titleHeight = KiROUND( 0.0, textSize * 2.0 ); if( PrintableCharCount( name ) * textSize < bbox.GetWidth() ) { diff --git a/pcbnew/router/router_status_view_item.cpp b/pcbnew/router/router_status_view_item.cpp index 1174a01949..5ffad18bea 100644 --- a/pcbnew/router/router_status_view_item.cpp +++ b/pcbnew/router/router_status_view_item.cpp @@ -70,7 +70,7 @@ void ROUTER_STATUS_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const GRTextWidth( m_hint, font, hintDims.GlyphSize, hintDims.StrokeWidth, false, false, fontMetrics ) ); - VECTOR2I margin( KiROUND( textDims.GlyphSize.x * 0.4 ), KiROUND( textDims.GlyphSize.y * 0.6 ) ); + VECTOR2I margin = KiROUND( textDims.GlyphSize.x * 0.4, textDims.GlyphSize.y * 0.6 ); VECTOR2I size( textWidth + margin.x, KiROUND( textDims.GlyphSize.y * 1.7 ) ); VECTOR2I offset( margin.x * 5, -( size.y + margin.y * 5 ) ); diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 179ab207fa..0fe456eafa 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -1861,7 +1861,7 @@ static VECTOR2I snapCorner( const VECTOR2I& aPrev, const VECTOR2I& aNext, const v = v.Resize( 1 ); VECTOR2D p = center + v * radius; - return VECTOR2I( KiROUND( p.x ), KiROUND( p.y ) ); + return KiROUND( p ); }; VECTOR2I p1 = project( center1 );