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/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 02afe60d578..3b5dc3f57b9 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1685,12 +1685,21 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph,
/* #Region */
int region_winx, region_winy;
rcti region_winrct;
+
+ /* #RegionView3D */
+ /**
+ * Needed so the value won't be left overwritten,
+ * Without this the #wmPaintCursor can't use the pixel size & view matrices for drawing.
+ */
+ struct RV3DMatrixStore *rv3d_mats;
} orig = {
.v3d_shading_type = v3d->shading.type,
.region_winx = region->winx,
.region_winy = region->winy,
.region_winrct = region->winrct,
+
+ .rv3d_mats = ED_view3d_mats_rv3d_backup(region->regiondata),
};
UI_Theme_Store(&orig.theme_state);
@@ -1748,6 +1757,9 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph,
region->winy = orig.region_winy;
region->winrct = orig.region_winrct;
+ ED_view3d_mats_rv3d_restore(region->regiondata, orig.rv3d_mats);
+ MEM_freeN(orig.rv3d_mats);
+
UI_Theme_Restore(&orig.theme_state);
v3d->shading.type = orig.v3d_shading_type;