Added top-center overlay position

pull/161/head
FlightlessMango 4 years ago
parent 9cf6c502d2
commit 3f4949f593

@ -1038,6 +1038,12 @@ void position_layer(struct overlay_params& params, ImVec2 window_size)
height - window_size.y - margin + params.offset_y),
ImGuiCond_Always);
break;
case LAYER_POSITION_TOP_CENTER:
printf("%f\n", width - window_size.x);
ImGui::SetNextWindowPos(ImVec2((width / 2) - (window_size.x / 2),
margin + params.offset_y),
ImGuiCond_Always);
break;
}
}

@ -34,6 +34,8 @@ parse_position(const char *str)
return LAYER_POSITION_BOTTOM_LEFT;
if (!strcmp(str, "bottom-right"))
return LAYER_POSITION_BOTTOM_RIGHT;
if (!strcmp(str, "top-center"))
return LAYER_POSITION_TOP_CENTER;
return LAYER_POSITION_TOP_LEFT;
}

@ -85,6 +85,7 @@ enum overlay_param_position {
LAYER_POSITION_TOP_RIGHT,
LAYER_POSITION_BOTTOM_LEFT,
LAYER_POSITION_BOTTOM_RIGHT,
LAYER_POSITION_TOP_CENTER,
};
enum overlay_plots {

Loading…
Cancel
Save