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:
authorCampbell Barton <ideasman42@gmail.com>2020-05-20 07:58:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-20 07:58:57 +0300
commit5fe7605f3df5a2a0c6a77cfe082ce15f6ebc25f8 (patch)
tree1e9a11a475a8320c59cbdcb355ad8b6d7931c8b1 /source/blender/windowmanager
parenta296dff2c86989bd04badfb241425268bfd62a5a (diff)
Fix the current pixelsize impacting thumbnails
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index b9f0e3686db..cc81e4f2715 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1212,6 +1212,7 @@ static ImBuf *blend_file_thumb(const bContext *C,
ImBuf *ibuf;
BlendThumbnail *thumb;
wmWindowManager *wm = CTX_wm_manager(C);
+ const float pixelsize_old = U.pixelsize;
wmWindow *windrawable_old = wm->windrawable;
char err_out[256] = "unknown";
@@ -1246,6 +1247,10 @@ static ImBuf *blend_file_thumb(const bContext *C,
/* gets scaled to BLEN_THUMB_SIZE */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
+ /* Note that with scaling, this ends up being 0.5,
+ * as it's a thumbnail, we don't need object centers and friends to be 1:1 size. */
+ U.pixelsize = 1.0f;
+
if (scene->camera) {
ibuf = ED_view3d_draw_offscreen_imbuf_simple(depsgraph,
scene,
@@ -1276,6 +1281,8 @@ static ImBuf *blend_file_thumb(const bContext *C,
err_out);
}
+ U.pixelsize = pixelsize_old;
+
/* Reset to old drawable. */
if (windrawable_old) {
wm_window_make_drawable(wm, windrawable_old);