Skip to content

Commit a4345b1

Browse files
authored
Specify default side for plane widget (#4504)
1 parent a2c4c50 commit a4345b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/MRViewer/MRPlaneWidget.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ bool PlaneWidget::onMouseUp_( Viewer::MouseButton, int )
211211
auto stopFar = viewport.unprojectFromViewportSpace( { viewportStop.x, viewportStop.y, 1.0f } );
212212

213213
auto prevNorm = plane_.n;
214+
if ( prevNorm == Vector3f() )
215+
prevNorm = viewport.getRightDirection();
214216
plane_ = Plane3f::fromDirAndPt( cross( ( stopFar - stop ).normalized(), ( stop - start ).normalized() ).normalized(), start );
215217
if ( angle( -plane_.n, prevNorm ) < angle( plane_.n, prevNorm ) )
216218
plane_ = -plane_;

0 commit comments

Comments
 (0)