diff options
author | David Robillard <d@drobilla.net> | 2025-02-06 14:47:28 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-06 14:47:28 -0500 |
commit | 07db9c2600f0f3b219903e14563d33360f2159ea (patch) | |
tree | b88b79e02108338eaf936dac3d764e836428bf34 /examples/pugl_cairo_demo.c | |
parent | 83ec362de059e27f9bae4ec15e2a701e4f1568fa (diff) | |
download | pugl-07db9c2600f0f3b219903e14563d33360f2159ea.tar.gz pugl-07db9c2600f0f3b219903e14563d33360f2159ea.tar.bz2 pugl-07db9c2600f0f3b219903e14563d33360f2159ea.zip |
Fully parenthesize mathematical expressions
Well, on X11 where I'm running clang-tidy anyway, there may be some stragglers
in the other platform implementations. Appeases the
readability-math-missing-parentheses check added in clang-tidy 19.
Diffstat (limited to 'examples/pugl_cairo_demo.c')
-rw-r--r-- | examples/pugl_cairo_demo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/pugl_cairo_demo.c b/examples/pugl_cairo_demo.c index d973d69..143f49e 100644 --- a/examples/pugl_cairo_demo.c +++ b/examples/pugl_cairo_demo.c @@ -100,8 +100,8 @@ buttonDraw(PuglTestApp* app, cairo_t* cr, const Button* but, const double time) cairo_set_font_size(cr, 32.0); cairo_text_extents(cr, but->label, &extents); cairo_move_to(cr, - (but->w / 2.0) - extents.width / 2, - (but->h / 2.0) + extents.height / 2); + (but->w / 2.0) - (extents.width / 2), + (but->h / 2.0) + (extents.height / 2)); cairo_set_source_rgba(cr, 0, 0, 0, 1); cairo_show_text(cr, but->label); @@ -114,7 +114,7 @@ postButtonRedisplay(PuglView* view) const ViewScale scale = getScale(view); for (const Button* b = buttons; b->label; ++b) { - const double span = sqrt(b->w * b->w + b->h * b->h); + const double span = sqrt((b->w * b->w) + (b->h * b->h)); puglObscureRegion(view, (int)((b->x - span) * scale.x), (int)((b->y - span) * scale.y), |