From 28b6c39fcb3b9ba15059a7c4fd82bd415a39dc4b Mon Sep 17 00:00:00 2001 From: Yousef Khadadeh Date: Thu, 10 Jul 2025 22:28:57 +0300 Subject: [PATCH] Use dropped item pos from SDL for native systems --- src/DrawingProgram/DrawingProgram.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/DrawingProgram/DrawingProgram.cpp b/src/DrawingProgram/DrawingProgram.cpp index f26ca25..8cc6842 100644 --- a/src/DrawingProgram/DrawingProgram.cpp +++ b/src/DrawingProgram/DrawingProgram.cpp @@ -346,8 +346,13 @@ void DrawingProgram::update() { void DrawingProgram::drag_drop_update() { if(controls.cursorHoveringOverCanvas) { for(auto& droppedItem : world.main.input.droppedItems) { - if(droppedItem.isFile && std::filesystem::is_regular_file(droppedItem.droppedData)) + if(droppedItem.isFile && std::filesystem::is_regular_file(droppedItem.droppedData)) { +#ifdef __EMSCRIPTEN_ add_file_to_canvas_by_path(droppedItem.droppedData, world.main.input.mouse.pos, true); +#else + add_file_to_canvas_by_path(droppedItem.droppedData, droppedItem.pos, true); +#endif + } } } }