mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 21:15:52 +08:00
fix mouse coordinate offset of dropped file
This commit is contained in:
parent
1c44fcab9e
commit
caf39213b3
@ -1656,8 +1656,11 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi
|
||||
if (filenames.size() == 1) {
|
||||
const wxString &filename = filenames.Last();
|
||||
const wxString file_extension = filename.substr(filename.length() - 4);
|
||||
if (file_extension.CmpNoCase(".svg") == 0)
|
||||
return emboss_svg(m_plater, filename, Vec2d(x, y));
|
||||
if (file_extension.CmpNoCase(".svg") == 0) {
|
||||
const wxPoint offset = m_plater.GetPosition();
|
||||
Vec2d mouse_position(x - offset.x, y - offset.y);
|
||||
return emboss_svg(m_plater, filename,mouse_position);
|
||||
}
|
||||
}
|
||||
bool res = m_plater.load_files(filenames);
|
||||
m_mainframe.update_title();
|
||||
|
Loading…
x
Reference in New Issue
Block a user