Skip to content

Commit

Permalink
Only transpose mid marker when one endpoint is outside the visible ex…
Browse files Browse the repository at this point in the history
…tent
  • Loading branch information
uclaros authored and nyalldawson committed Apr 17, 2021
1 parent cf46424 commit ec7b288
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit ec7b288

Please sign in to comment.