Skip to content

Commit

Permalink
Merge pull request 'Fix bug #72825' (#227) from fix/bug72825 into hot…
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaSubbotina committed Feb 11, 2025
2 parents 7bfcea0 + b65ed1c commit 8098fec
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions OdfFile/Reader/Format/draw_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,14 @@ void Compute_GradientFill(draw_gradient* gradient_style, oox::oox_gradient_fill_
if (gradient_style->draw_style_)
style = gradient_style->draw_style_->get_type();

if (gradient_style->draw_angle_)
fill->angle = -90 - gradient_style->draw_angle_->get_value();
if (gradient_style->draw_angle_)
{
double angle = std::fmod(gradient_style->draw_angle_->get_value(), 360.0);
if (angle < 0)
angle += 360.0;

fill->angle = -angle + 90;
}

if (fill->angle < 0)
{
Expand All @@ -322,7 +328,7 @@ void Compute_GradientFill(draw_gradient* gradient_style, oox::oox_gradient_fill_
if (gradient_stop->color_value_)
fill->colors[i].color_ref = gradient_stop->color_value_->get_hex_value();
if (gradient_stop->svg_offset_)
fill->colors[i].pos = 100 - *gradient_stop->svg_offset_ * 100;
fill->colors[i].pos = *gradient_stop->svg_offset_ * 100;
}
}
fill->style = 0;
Expand Down

0 comments on commit 8098fec

Please sign in to comment.