diff --git a/source/blender/editors/include/UI_interface_icons.hh b/source/blender/editors/include/UI_interface_icons.hh index 7704a9bed4e..99a09bc8d5d 100644 --- a/source/blender/editors/include/UI_interface_icons.hh +++ b/source/blender/editors/include/UI_interface_icons.hh @@ -38,6 +38,8 @@ struct IconTextOverlay { #define PREVIEW_DEFAULT_HEIGHT 128 +#define PREVIEW_DRAG_DRAW_SIZE 96.0f + enum eAlertIcon { ALERT_ICON_NONE = -1, ALERT_ICON_WARNING = 0, diff --git a/source/blender/editors/space_file/file_draw.cc b/source/blender/editors/space_file/file_draw.cc index dd3480ed43f..1a8092464df 100644 --- a/source/blender/editors/space_file/file_draw.cc +++ b/source/blender/editors/space_file/file_draw.cc @@ -644,8 +644,8 @@ static void file_add_preview_drag_but(const SpaceFile *sfile, const ImBuf *drag_image = preview_image ? preview_image : /* Larger directory or document icon. */ filelist_geticon_special_file_image_ex(file); - const auto [scaled_width, scaled_height, scale] = preview_image_scaled_dimensions_get( - drag_image->x, drag_image->y, *layout); + const float scale = (PREVIEW_DRAG_DRAW_SIZE * UI_SCALE_FAC) / + std::max(drag_image->x, drag_image->y); file_but_enable_drag(but, sfile, file, path, drag_image, file_type_icon, scale); file_but_tooltip_func_set(sfile, file, but); } diff --git a/source/blender/windowmanager/intern/wm_dragdrop.cc b/source/blender/windowmanager/intern/wm_dragdrop.cc index 4fa69d440d0..616a703b280 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.cc +++ b/source/blender/windowmanager/intern/wm_dragdrop.cc @@ -1035,7 +1035,7 @@ static int wm_drag_imbuf_icon_height_get(const wmDrag *drag) static int wm_drag_preview_icon_size_get() { - return UI_preview_tile_size_x(); + return int(PREVIEW_DRAG_DRAW_SIZE * UI_SCALE_FAC); } static void wm_drag_draw_icon(bContext * /*C*/, wmWindow * /*win*/, wmDrag *drag, const int xy[2]) @@ -1072,7 +1072,7 @@ static void wm_drag_draw_icon(bContext * /*C*/, wmWindow * /*win*/, wmDrag *drag x = xy[0] - (size / 2); y = xy[1] - (size / 2); - UI_icon_draw_preview(x, y, drag->preview_icon_id, UI_INV_SCALE_FAC, 0.8, size); + UI_icon_draw_preview(x, y, drag->preview_icon_id, 1.0, 0.8, size); } else { int padding = 4 * UI_SCALE_FAC;