← Back to team overview

kicad-developers team mailing list archive

Re: [feature] Simpler edition of custom pads

 

Very nice!

I have one minor kibble with the use of boost::optional as it throws
compile warnings.  I'm attaching a proposed patch that silences the warning
by initializing the optional to boost::none.

-S

On Thu, Oct 19, 2017 at 2:36 PM, Tomasz Wlostowski <
tomasz.wlostowski@xxxxxxx> wrote:

> Dear all,
>
> I've just pushed a set of patches that simplifies drawing and editing
> custom pad shapes:
>
> - Now you can draw a number of graphic primitives in the footprint
> editor, select them together and R-click->Create Pad From Selected
> Shapes) to convert them to a custom-shaped pad.
>
> - ... and the opposite: take a custom shaped pad, R-click->Explode
> Selected Pad to Graphical Shapes to convert the pad back to the original
> graphical primitives.
>
> - By default, the newly made pad's anchor is calculated automatically.
> If you need a special 'anchor' pad, draw it using the pad tool and
> select together with the graphical primitives that make the desired
> custom pad.
>
> - I forgot to mention, it's now possible to draw graphical polygons (not
> zones) both in pcbnew and in the footprint editor. Use with care, as
> polygons on copper layers are *NOT* handled by the DRC (yet).
>
> Testing & feedback very much appreciated!
>
> Cheers,
> Tom
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
From cd2761d981e8813e58cbe653555c8e6b72eea06f Mon Sep 17 00:00:00 2001
From: Seth Hillbrand <hillbrand@xxxxxxxxxxx>
Date: Fri, 20 Oct 2017 09:33:19 -0700
Subject: [PATCH] pcbnew: suppress compile warning on boost::optional

---
 pcbnew/class_pad_custom_shape_functions.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pcbnew/class_pad_custom_shape_functions.cpp b/pcbnew/class_pad_custom_shape_functions.cpp
index 779538e38..56c1aa439 100644
--- a/pcbnew/class_pad_custom_shape_functions.cpp
+++ b/pcbnew/class_pad_custom_shape_functions.cpp
@@ -359,7 +359,7 @@ bool D_PAD::GetBestAnchorPosition( VECTOR2I& aPos )
         minDistEdge = std::max( GetSize().x, GetSize().y );
     }
 
-    boost::optional<VECTOR2I> bestAnchor;
+    auto bestAnchor( []()->boost::optional<VECTOR2I>{ return boost::none; }() );
 
     for ( int y = 0; y < stepsY ; y++ )
     {
-- 
2.11.0


Follow ups

References