diff options
author | P. J. McDermott <pj@pehjota.net> | 2022-01-29 03:35:13 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2022-01-29 03:35:13 (EST) |
commit | 870b90b1c7be40e53b494b04a758d41fa4f3dedd (patch) | |
tree | 8e148d71c9573b92fad78c71998e232d268a191a /src/tk | |
parent | 7d54dc4b520c2193a2f9517df469a0df4257e4e5 (diff) | |
download | mazefight-870b90b1c7be40e53b494b04a758d41fa4f3dedd.zip mazefight-870b90b1c7be40e53b494b04a758d41fa4f3dedd.tar.gz mazefight-870b90b1c7be40e53b494b04a758d41fa4f3dedd.tar.bz2 |
tk: Fix size and rendering position of check
Diffstat (limited to 'src/tk')
-rw-r--r-- | src/tk/check.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tk/check.c b/src/tk/check.c index e425467..fd23b6a 100644 --- a/src/tk/check.c +++ b/src/tk/check.c @@ -88,7 +88,7 @@ _mftk_check_layout(struct mftk_widget *w) mftk_widget_layout(c->label); } - w->w = c->butn_width + c->butn_border; + w->w = c->butn_width + c->butn_border * 2; if (c->label != NULL) { w->w += c->label_padding + c->label->w; } @@ -240,8 +240,8 @@ _mftk_check_render(struct mftk_widget *w, SDL_Renderer *renderer, int x, int y) render = &_mftk_check_render_cir; } - rect.x = x - c->butn_border; - rect.y = y - c->butn_border; + rect.x = x; + rect.y = y; rect.w = c->butn_width + c->butn_border * 2; rect.h = c->butn_width + c->butn_border * 2; if (w->focused == SDL_TRUE) { @@ -253,10 +253,10 @@ _mftk_check_render(struct mftk_widget *w, SDL_Renderer *renderer, int x, int y) e = -1; } - rect.x = x; - rect.y = y; - rect.w = c->butn_width; - rect.h = c->butn_width; + rect.x += c->butn_border; + rect.y += c->butn_border; + rect.w -= c->butn_border * 2; + rect.h -= c->butn_border * 2; if (render(&rect, &_mftk_check_butn_color, renderer) < 0) { e = -1; } |