Skip to content
Permalink
Browse files
Only transpose mid marker when one endpoint is outside the visible ex…
…tent
  • Loading branch information
uclaros authored and nyalldawson committed Apr 17, 2021
1 parent cf46424 commit ec7b2889c414a0312b5324df8d07ed9c36b545a5
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/app/vertextool/qgsvertextool.cpp
@@ -2642,7 +2642,9 @@ bool QgsVertexTool::matchEdgeCenterTest( const QgsPointLocator::Match &m, const
return false; // currently not supported for circular edges

QgsRectangle visible_extent = canvas()->mapSettings().visibleExtent();
if ( !visible_extent.contains( p0 ) || !visible_extent.contains( p1 ) )
// Check if one point is inside and the other outside the visible extent in order to transpose the mid marker
// If both are inside or outside there is no such need
if ( !visible_extent.contains( p0 ) != !visible_extent.contains( p1 ) )
{
// clip line segment to the extent so the mid-point marker is always visible
QgsGeometry extentGeom = QgsGeometry::fromRect( visible_extent );

0 comments on commit ec7b288

Please sign in to comment.