mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-19 13:56:06 -04:00
UI: Center preview spacing lines
Currently, the spacing lines begin in the middle of the box and then are their width wide towards one direction. This means that the larger they are, the more off-center their middle is. This commit changes them to start at half their width left/top of the center and end half the width to the right/bottom of the center, putting the middle in the center.
This commit is contained in:
@@ -1758,13 +1758,16 @@ static void DrawLine(float x1, float y1, float x2, float y2, float thickness,
|
||||
|
||||
gs_render_start(true);
|
||||
|
||||
gs_vertex2f(x1, y1);
|
||||
gs_vertex2f(x1 + (xSide * (thickness / scale.x)),
|
||||
y1 + (ySide * (thickness / scale.y)));
|
||||
gs_vertex2f(x2 + (xSide * (thickness / scale.x)),
|
||||
y2 + (ySide * (thickness / scale.y)));
|
||||
gs_vertex2f(x2, y2);
|
||||
gs_vertex2f(x1, y1);
|
||||
gs_vertex2f(x1 - (xSide * (thickness / scale.x) / 2),
|
||||
y1 + (ySide * (thickness / scale.y) / 2));
|
||||
gs_vertex2f(x1 + (xSide * (thickness / scale.x) / 2),
|
||||
y1 - (ySide * (thickness / scale.y) / 2));
|
||||
gs_vertex2f(x2 + (xSide * (thickness / scale.x) / 2),
|
||||
y2 + (ySide * (thickness / scale.y) / 2));
|
||||
gs_vertex2f(x2 - (xSide * (thickness / scale.x) / 2),
|
||||
y2 - (ySide * (thickness / scale.y) / 2));
|
||||
gs_vertex2f(x1 - (xSide * (thickness / scale.x) / 2),
|
||||
y1 + (ySide * (thickness / scale.y) / 2));
|
||||
|
||||
gs_vertbuffer_t *line = gs_render_save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user