Skip to content

Commit 2867e55

Browse files
committed
Fix convertson of css deg to xtd deg
1 parent 243e30e commit 2867e55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xtd.forms/src/xtd/forms/style_sheets/background_image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void background_image::image_type(style_sheets::image_type value) noexcept {
7676

7777
xtd::uptr<xtd::drawing::brush> background_image::make_brush(const xtd::forms::style_sheets::background_image& image, const xtd::drawing::rectangle& rect) {
7878
if (image.image_type() == style_sheets::image_type::linear_gradient)
79-
return xtd::new_uptr<linear_gradient_brush>(rect, image.colors(), as<float>(image.angle() - 90.0f));
79+
return xtd::new_uptr<linear_gradient_brush>(rect, image.colors(), as<float>(image.angle()) >= 90 ? as<float>(image.angle()) - 90.0 : 360.0f + as<float>(image.angle()) - 90.0f);
8080
if (image.image_type() == style_sheets::image_type::url)
8181
return xtd::new_uptr<texture_brush>(image::from_file(image.url().to_string()));
8282
return nullptr;

0 commit comments

Comments
 (0)