mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
DragDrop: Removed const qualifier from ImGuiPayload 's void* data, easing casting on user side.
This commit is contained in:
parent
d317951b37
commit
f2e9dddeca
@ -13029,14 +13029,14 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s
|
|||||||
// Store in heap
|
// Store in heap
|
||||||
g.DragDropPayloadBufHeap.resize((int)data_size);
|
g.DragDropPayloadBufHeap.resize((int)data_size);
|
||||||
payload.Data = g.DragDropPayloadBufHeap.Data;
|
payload.Data = g.DragDropPayloadBufHeap.Data;
|
||||||
memcpy((void*)(intptr_t)payload.Data, data, data_size);
|
memcpy(payload.Data, data, data_size);
|
||||||
}
|
}
|
||||||
else if (data_size > 0)
|
else if (data_size > 0)
|
||||||
{
|
{
|
||||||
// Store locally
|
// Store locally
|
||||||
memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal));
|
memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal));
|
||||||
payload.Data = g.DragDropPayloadBufLocal;
|
payload.Data = g.DragDropPayloadBufLocal;
|
||||||
memcpy((void*)(intptr_t)payload.Data, data, data_size);
|
memcpy(payload.Data, data, data_size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
2
imgui.h
2
imgui.h
@ -1374,7 +1374,7 @@ struct ImGuiSizeCallbackData
|
|||||||
struct ImGuiPayload
|
struct ImGuiPayload
|
||||||
{
|
{
|
||||||
// Members
|
// Members
|
||||||
const void* Data; // Data (copied and owned by dear imgui)
|
void* Data; // Data (copied and owned by dear imgui)
|
||||||
int DataSize; // Data size
|
int DataSize; // Data size
|
||||||
|
|
||||||
// [Internal]
|
// [Internal]
|
||||||
|
Loading…
Reference in New Issue
Block a user