Fix #114714: Rotating the View can drastically change the view's position when Auto Depth or Orbit Arround Select is set

Caused by 6faa39edb7

In that commit it was assumed that the view offset does not need to be
updated if the operator is `V3D_OP_MODE_ROTATE` instead of simply
checking `this->use_dyn_ofs`.

Since `use_dyn_ofs` is always `True` when using Auto Depth or Orbit
Arround Select, the offset should always be updated in these cases.
This commit is contained in:
Germano Cavalcante 2023-11-10 19:07:25 -03:00
parent eaef914487
commit 172221e7fb

@ -279,8 +279,9 @@ void ViewOpsData::init_navigation(bContext *C,
negate_v3_v3(this->dyn_ofs, pivot_new);
this->use_dyn_ofs = true;
if (!(nav_type->flag & VIEWOPS_FLAG_ORBIT_SELECT)) {
/* Calculate new #RegionView3D::ofs and #RegionView3D::dist. */
{
/* The pivot has changed so the offset needs to be updated as well.
* Calculate new #RegionView3D::ofs and #RegionView3D::dist. */
if (rv3d->is_persp) {
float my_origin[3]; /* Original #RegionView3D.ofs. */