diff options
author | Julian Eisel <julian@blender.org> | 2021-11-18 13:23:15 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-11-18 13:47:21 +0300 |
commit | e5774282b94772af8822f4e3ab8b24207a450fb8 (patch) | |
tree | de686b5cdabb16597a7d4d06c22e16f80169cd8b /source/blender/windowmanager/intern/wm_dragdrop.c | |
parent | 8c0370ef7b8d2854ca6eac8f57c626bb3c4b2f2b (diff) |
Fix asset preview not showing up for current file data-blocks
For data-blocks from the current file, the image-buffer for dragging
wasn't set at all. This wasn't intentional, dragging things in the Asset
Browser should just always show the preview.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_dragdrop.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_dragdrop.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 64aa55c058c..49b84abf9a2 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -767,6 +767,12 @@ static void wm_drag_draw_icon(bContext *UNUSED(C), const int xy[2]) { int x, y; + + /* This could also get the preview image of an ID when dragging one. But the big preview icon may + * actually not always be wanted, for example when dragging objects in the Outliner it gets in + * the way). So make the drag user set an image buffer explicitly (e.g. through + * #UI_but_drag_attach_image()). */ + if (drag->imb) { x = xy[0] - drag->sx / 2; y = xy[1] - drag->sy / 2; |