Use dropped item pos from SDL for native systems

This commit is contained in:
Yousef Khadadeh 2025-07-10 22:28:57 +03:00
parent e901ceec2b
commit 28b6c39fcb

View file

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