diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 18:27:07 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 18:27:07 -0500 |
commit | 2baf965c7db4a3640cd120e050c61aa7de67448b (patch) | |
tree | 4ea6d87d6157b3d25eba24aa8805a10219c44a2f /gl.c | |
parent | 3ff107c7ca438749a8425feef9eefb67c7a8abfc (diff) |
node resizing working
Diffstat (limited to 'gl.c')
-rw-r--r-- | gl.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -212,6 +212,10 @@ static void gl_geometry_rect(Rect r, u32 color_rgba) { static void gl_geometry_rect_border(Rect r, float border_thickness, u32 color) { float border_radius = border_thickness * 0.5f; float x1 = r.pos.x, y1 = r.pos.y, x2 = x1 + r.size.x, y2 = y1 + r.size.y; + + // make sure rectangle isn't too small + x2 = maxf(x2, x1 + 2 * border_radius); + y2 = maxf(y2, y1 + 2 * border_radius); gl_geometry_rect(rect4(x1+border_radius, y1-border_radius, x2+border_radius, y1+border_radius), color); gl_geometry_rect(rect4(x1-border_radius, y2-border_radius, x2-border_radius, y2+border_radius), color); |