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.
This commit is contained in:
2021-11-18 11:23:15 +01:00
parent 8c0370ef7b
commit e5774282b9
4 changed files with 24 additions and 4 deletions

View File

@@ -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;