From: Lionel Landwerlin Date: Sat, 2 Mar 2019 17:29:12 +0000 (+0000) Subject: vulkan/overlay: add a margin to the size of the window X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=commitdiff_plain;h=74a9fdd8a28619599404bdde55f85324b744976d vulkan/overlay: add a margin to the size of the window Looks a bit better. Signed-off-by: Lionel Landwerlin --- diff --git a/src/vulkan/overlay-layer/overlay.cpp b/src/vulkan/overlay-layer/overlay.cpp index 2aa0bf93e6b..28a63fbbf92 100644 --- a/src/vulkan/overlay-layer/overlay.cpp +++ b/src/vulkan/overlay-layer/overlay.cpp @@ -571,24 +571,25 @@ static void position_layer(struct swapchain_data *data) { struct device_data *device_data = data->device; struct instance_data *instance_data = device_data->instance; + const float margin = 10.0f; ImGui::SetNextWindowBgAlpha(0.5); ImGui::SetNextWindowSize(data->window_size, ImGuiCond_Always); switch (instance_data->params.position) { case LAYER_POSITION_TOP_LEFT: - ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always); + ImGui::SetNextWindowPos(ImVec2(margin, margin), ImGuiCond_Always); break; case LAYER_POSITION_TOP_RIGHT: - ImGui::SetNextWindowPos(ImVec2(data->width - data->window_size.x, 0), + ImGui::SetNextWindowPos(ImVec2(data->width - data->window_size.x - margin, margin), ImGuiCond_Always); break; case LAYER_POSITION_BOTTOM_LEFT: - ImGui::SetNextWindowPos(ImVec2(0, data->height - data->window_size.y), + ImGui::SetNextWindowPos(ImVec2(margin, data->height - data->window_size.y - margin), ImGuiCond_Always); break; case LAYER_POSITION_BOTTOM_RIGHT: - ImGui::SetNextWindowPos(ImVec2(data->width - data->window_size.x, - data->height - data->window_size.y), + ImGui::SetNextWindowPos(ImVec2(data->width - data->window_size.x - margin, + data->height - data->window_size.y - margin), ImGuiCond_Always); break; }