Skip to content

Commit

Permalink
Sketcher: fix back face picking detection when editing
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed May 12, 2021
1 parent 4dd0011 commit d75e89f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2938,9 +2938,11 @@ void ViewProviderSketch::updateColor(void)

SbVec3f pnt, dir;
edit->viewer->getNearPlane(pnt, dir);
auto pla = getEditingPlacement();
Base::Vector3d norm(0, 0, 1);
pla.multVec(norm, norm);
auto transform = getEditingPlacement();
Base::Vector3d v0, v1;
transform.multVec(Base::Vector3d(0,0,0), v0);
transform.multVec(Base::Vector3d(0,0,1), v1);
Base::Vector3d norm = v1 - v0;
norm.Normalize();
float zdir = norm.Dot(Base::Vector3d(dir[0], dir[1], dir[2])) < 0.0f ? -1.0 : 1.0;

Expand Down

0 comments on commit d75e89f

Please sign in to comment.