Skip to content

Commit

Permalink
Fix wave
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Nov 6, 2023
1 parent ac44f40 commit 64bf744
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace xtd::forms {
public:
void on_paint(xtd::drawing::graphics& graphics, const xtd::drawing::rectangle& clip_rectangle, const xtd::drawing::color& color, bool enabled) override {
//graphics.translate_transform(clip_rectangle.center().x(), clip_rectangle.center().y());
auto angle = -360.f / intervals_;
//auto angle = -360.f / intervals_;
//graphics.rotate_transform(frame_ * angle);
auto height = static_cast<float>(xtd::math::min(clip_rectangle.width(), clip_rectangle.height())) / radius_factor_;
auto width = static_cast<float>(xtd::math::min(clip_rectangle.width(), clip_rectangle.height())) / radius_factor_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ namespace xtd::forms {
auto wave4 = enabled ? std::vector {0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 4, 0, 0, 0} : std::vector {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
auto wave5 = enabled ? std::vector {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 4} : std::vector {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + line_height / wave1[frame_] / 2, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + line_height / wave2[frame_] / 2, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + line_height / wave3[frame_] / 2, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + line_height / wave4[frame_] / 2, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + line_height / wave5[frame_] / 2, line_width, line_height - line_height / wave5[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + wave1[frame_] ? line_height / wave1[frame_] / 2 : 0, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + wave2[frame_] ? line_height / wave2[frame_] / 2 : 0, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + wave3[frame_] ? line_height / wave3[frame_] / 2 : 0, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + wave4[frame_] ? line_height / wave4[frame_] / 2 : 0, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + wave5[frame_] ? line_height / wave5[frame_] / 2 : 0, line_width, line_height - line_height / wave5[frame_], line_width / 2);
}

void on_timer() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ namespace xtd::forms {
auto wave4 = enabled ? std::vector {16, 8, 4, 2, 4, 8, 16, 0} : std::vector {0, 0, 0, 0, 0, 0, 0, 0};
auto wave5 = enabled ? std::vector {8, 4, 2, 4, 8, 16, 0, 16} : std::vector {0, 0, 0, 0, 0, 0, 0, 0};

graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + line_height / wave1[frame_] / 2, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + line_height / wave2[frame_] / 2, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + line_height / wave3[frame_] / 2, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + line_height / wave4[frame_] / 2, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + line_height / wave5[frame_] / 2, line_width, line_height - line_height / wave5[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + wave1[frame_] ? line_height / wave1[frame_] / 2 : 0, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + wave2[frame_] ? line_height / wave2[frame_] / 2 : 0, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + wave3[frame_] ? line_height / wave3[frame_] / 2 : 0, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + wave4[frame_] ? line_height / wave4[frame_] / 2 : 0, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + wave5[frame_] ? line_height / wave5[frame_] / 2 : 0, line_width, line_height - line_height / wave5[frame_], line_width / 2);
}

void on_timer() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ namespace xtd::forms {
auto wave4 = enabled ? std::vector {0, 0, 0, 0, 4, 2, 2, 2, 2, 2, 4, 0} : std::vector {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
auto wave5 = enabled ? std::vector {0, 0, 0, 0, 0, 4, 2, 2, 2, 2, 2, 4} : std::vector {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + line_height / wave1[frame_] / 2, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + line_height / wave2[frame_] / 2, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + line_height / wave3[frame_] / 2, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + line_height / wave4[frame_] / 2, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + line_height / wave5[frame_] / 2, line_width, line_height - line_height / wave5[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + wave1[frame_] ? line_height / wave1[frame_] / 2 : 0, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + wave2[frame_] ? line_height / wave2[frame_] / 2 : 0, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + wave3[frame_] ? line_height / wave3[frame_] / 2 : 0, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + wave4[frame_] ? line_height / wave4[frame_] / 2 : 0, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + wave5[frame_] ? line_height / wave5[frame_] / 2 : 0, line_width, line_height - line_height / wave5[frame_], line_width / 2);
}

void on_timer() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ namespace xtd::forms {
auto wave4 = enabled ? std::vector {2, 2, 2, 4, 0, 4, 2, 2, 2} : std::vector {2, 2, 2, 2, 2, 2, 2, 2, 2};
auto wave5 = enabled ? std::vector {2, 2, 2, 2, 2, 2, 4, 0, 4} : std::vector {2, 2, 2, 2, 2, 2, 2, 2, 2};

graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + line_height / wave1[frame_] / 2, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + line_height / wave2[frame_] / 2, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + line_height / wave3[frame_] / 2, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + line_height / wave4[frame_] / 2, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + line_height / wave5[frame_] / 2, line_width, line_height - line_height / wave5[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + wave1[frame_] ? line_height / wave1[frame_] / 2 : 0, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + wave2[frame_] ? line_height / wave2[frame_] / 2 : 0, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + wave3[frame_] ? line_height / wave3[frame_] / 2 : 0, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + wave4[frame_] ? line_height / wave4[frame_] / 2 : 0, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + wave5[frame_] ? line_height / wave5[frame_] / 2 : 0, line_width, line_height - line_height / wave5[frame_], line_width / 2);
}

void on_timer() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ namespace xtd::forms {
auto wave4 = enabled ? std::vector {16, 8, 4, 2, 4, 8, 16, 0} : std::vector {0, 0, 0, 0, 0, 0, 0, 0};
auto wave5 = enabled ? std::vector {0, 16, 8, 4, 2, 4, 8, 16} : std::vector {0, 0, 0, 0, 0, 0, 0, 0};

graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + line_height / wave1[frame_] / 2, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + line_height / wave2[frame_] / 2, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + line_height / wave3[frame_] / 2, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + line_height / wave4[frame_] / 2, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + line_height / wave5[frame_] / 2, line_width, line_height - line_height / wave5[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x1, y + wave1[frame_] ? line_height / wave1[frame_] / 2 : 0, line_width, line_height - line_height / wave1[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x2, y + wave2[frame_] ? line_height / wave2[frame_] / 2 : 0, line_width, line_height - line_height / wave2[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x3, y + wave3[frame_] ? line_height / wave3[frame_] / 2 : 0, line_width, line_height - line_height / wave3[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x4, y + wave4[frame_] ? line_height / wave4[frame_] / 2 : 0, line_width, line_height - line_height / wave4[frame_], line_width / 2);
graphics.fill_rounded_rectangle(xtd::drawing::solid_brush {xtd::drawing::color::from_argb(static_cast<xtd::byte>(opacity), color)}, x5, y + wave5[frame_] ? line_height / wave5[frame_] / 2 : 0, line_width, line_height - line_height / wave5[frame_], line_width / 2);
}

void on_timer() override {
Expand Down

0 comments on commit 64bf744

Please sign in to comment.