summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-03-02 17:29:12 +0000
committerLionel Landwerlin <[email protected]>2019-05-02 17:02:07 +0100
commit74a9fdd8a28619599404bdde55f85324b744976d (patch)
treed4590fa5c51c4d7115958371b6c94a54e861f528 /src
parent7ba50d80408080a94d605673efb5b870520dea87 (diff)
vulkan/overlay: add a margin to the size of the window
Looks a bit better. Signed-off-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/overlay-layer/overlay.cpp11
1 files changed, 6 insertions, 5 deletions
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;
}