From 968a55f12da963d2250f1489c646d15b2217f9cc Mon Sep 17 00:00:00 2001 From: Gammasoft Date: Tue, 19 Sep 2023 13:13:10 +0200 Subject: [PATCH] Review code --- .../src/xtd/drawing/drawing_2d/radial_gradient_brush.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/xtd.drawing/src/xtd/drawing/drawing_2d/radial_gradient_brush.cpp b/src/xtd.drawing/src/xtd/drawing/drawing_2d/radial_gradient_brush.cpp index 660ed4889369..96e7c284b3ac 100644 --- a/src/xtd.drawing/src/xtd/drawing/drawing_2d/radial_gradient_brush.cpp +++ b/src/xtd.drawing/src/xtd/drawing/drawing_2d/radial_gradient_brush.cpp @@ -48,8 +48,8 @@ radial_gradient_brush::radial_gradient_brush(const xtd::drawing::point_f& center data_->center_point = center; data_->focal_point = center; data_->radius = radius; - float pos = 0; - float increment = 1.0f / (radial_colors.size() - 1); + auto pos = .0f; + auto increment = 1.0f / (radial_colors.size() - 1); for (auto color : radial_colors) { data_->radial_colors.push_back({color, pos}); pos += increment; @@ -125,10 +125,8 @@ bool radial_gradient_brush::equals(const radial_gradient_brush& value) const noe } void radial_gradient_brush::recreate_handle() { - vector> colors; - + auto colors = vector> {}; for_each(data_->radial_colors.begin(), data_->radial_colors.end(), [&](auto color) {colors.emplace_back(color.first.r(), color.first.g(), color.first.b(), color.first.a(), color.second);}); - native::brush::radial_gradient(handle(), as(data_->center_point.x()), as(data_->center_point.y()), as(data_->focal_point.x()), as(data_->focal_point.y()), colors, data_->radius); }