Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c20
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c4
2 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 19aa9cb203b..7fafd9f7cd2 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -822,7 +822,7 @@ static void viewrotate_apply(ViewOpsData *vod, const int event_xy[2])
float xaxis[3];
/* Radians per-pixel. */
- const float sensitivity = U.view_rotate_sensitivity_turntable / U.pixelsize;
+ const float sensitivity = U.view_rotate_sensitivity_turntable / U.dpi_fac;
/* Get the 3x3 matrix and its inverse from the quaternion */
quat_to_mat3(m, vod->curr.viewquat);
@@ -2038,7 +2038,7 @@ static float viewzoom_scale_value(const rcti *winrct,
fac = (float)(xy_init[1] - xy_curr[1]);
}
- fac /= U.pixelsize;
+ fac /= U.dpi_fac;
if (zoom_invert != zoom_invert_force) {
fac = -fac;
@@ -2055,8 +2055,8 @@ static float viewzoom_scale_value(const rcti *winrct,
BLI_rcti_cent_x(winrct),
BLI_rcti_cent_y(winrct),
};
- float len_new = (5 * U.pixelsize) + ((float)len_v2v2_int(ctr, xy_curr) / U.pixelsize);
- float len_old = (5 * U.pixelsize) + ((float)len_v2v2_int(ctr, xy_init) / U.pixelsize);
+ float len_new = (5 * U.dpi_fac) + ((float)len_v2v2_int(ctr, xy_curr) / U.dpi_fac);
+ float len_old = (5 * U.dpi_fac) + ((float)len_v2v2_int(ctr, xy_init) / U.dpi_fac);
/* intentionally ignore 'zoom_invert' for scale */
if (zoom_invert_force) {
@@ -2066,16 +2066,16 @@ static float viewzoom_scale_value(const rcti *winrct,
zfac = val_orig * (len_old / max_ff(len_new, 1.0f)) / val;
}
else { /* USER_ZOOM_DOLLY */
- float len_new = 5 * U.pixelsize;
- float len_old = 5 * U.pixelsize;
+ float len_new = 5 * U.dpi_fac;
+ float len_old = 5 * U.dpi_fac;
if (U.uiflag & USER_ZOOM_HORIZ) {
- len_new += (winrct->xmax - (xy_curr[0])) / U.pixelsize;
- len_old += (winrct->xmax - (xy_init[0])) / U.pixelsize;
+ len_new += (winrct->xmax - (xy_curr[0])) / U.dpi_fac;
+ len_old += (winrct->xmax - (xy_init[0])) / U.dpi_fac;
}
else {
- len_new += (winrct->ymax - (xy_curr[1])) / U.pixelsize;
- len_old += (winrct->ymax - (xy_init[1])) / U.pixelsize;
+ len_new += (winrct->ymax - (xy_curr[1])) / U.dpi_fac;
+ len_old += (winrct->ymax - (xy_init[1])) / U.dpi_fac;
}
if (zoom_invert != zoom_invert_force) {
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 66efa5b5de3..839f8c60a66 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1733,6 +1733,8 @@ void ED_view3d_xr_shading_update(wmWindowManager *wm, const View3D *v3d, const S
{
if (v3d->runtime.flag & V3D_RUNTIME_XR_SESSION_ROOT) {
View3DShading *xr_shading = &wm->xr.session_settings.shading;
+ /* Flags that shouldn't be overridden by the 3D View shading. */
+ const int flag_copy = V3D_SHADING_WORLD_ORIENTATION;
BLI_assert(WM_xr_session_exists(&wm->xr));
@@ -1750,7 +1752,9 @@ void ED_view3d_xr_shading_update(wmWindowManager *wm, const View3D *v3d, const S
}
/* Copy shading from View3D to VR view. */
+ const int old_xr_shading_flag = xr_shading->flag;
*xr_shading = v3d->shading;
+ xr_shading->flag = (xr_shading->flag & ~flag_copy) | (old_xr_shading_flag & flag_copy);
if (v3d->shading.prop) {
xr_shading->prop = IDP_CopyProperty(xr_shading->prop);
}