Hi Martin,

You rock!

Thanks.

On 2017-09-29 09:15, Martin Dobias wrote:
Hi Loïc

On Tue, Sep 26, 2017 at 11:08 PM, L.Bartoletti
<lbartole...@tuxfamily.org> wrote:
Hi,

For a few days now QgsMapMouseEvent:: snapSegment is no longer usable
(moved). I need these tools to create circles with tangents
(https://github.com/qgis/QGIS/pull/4947).

Is there another way to get segments by snapping?

Yes - here's the code you need to snap to segments - equivalent to a
snapSegment() call:

struct EdgesOnlyFilter : public QgsPointLocator::MatchFilter
{
  bool acceptMatch( const QgsPointLocator::Match &m ) override {
return m.hasEdge(); }
};

EdgesOnlyFilter filter;
match = mapCanvas->snappingUtils()->snapToMap( mapPoint, &filter );

Regards
Martin
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to