From e5774282b94772af8822f4e3ab8b24207a450fb8 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 18 Nov 2021 11:23:15 +0100 Subject: 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. --- source/blender/windowmanager/intern/wm_dragdrop.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/windowmanager') 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; -- cgit v1.2.3