Skip to content

Commit

Permalink
Review code
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Sep 22, 2023
1 parent b393d17 commit d6ede19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/xtd.forms.examples/others/wiggly/src/wiggly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace wiggly_example {
static const vector sins = {0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38};
auto pos = point {(e.clip_rectangle().size().width() - as<int>(e.graphics().measure_string(text(), font()).width())) / 2, (e.clip_rectangle().size().height() - as<int>(e.graphics().measure_string(text(), font()).height())) / 2};
auto wiggly_text = as<u32string>(text());
for (auto i = 0U; i < wiggly_text.length(); i++) {
for (auto i = 0_sz; i < wiggly_text.length(); i++) {
auto index = (step + i) % sins.size();
e.graphics().draw_string(ustring::format("{}", wiggly_text[i]), font(), solid_brush {color::from_hsb(360.0f / sins.size() * index, 1.0f, 0.75f)}, point::subtract(pos, point(0, sins[index] * font().height() / 400)));
pos.x(pos.x() + as<int>(e.graphics().measure_string(ustring::format("{}", wiggly_text[i]), font()).width()));
Expand Down

0 comments on commit d6ede19

Please sign in to comment.