Skip to content

Commit

Permalink
Complete radial gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangfitus committed Dec 23, 2023
1 parent e5ffdaf commit 9de9781
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 101 deletions.
178 changes: 89 additions & 89 deletions external/samples/TestCases/Firefox_logo,_2019.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 1 addition & 12 deletions src/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,6 @@ Gdiplus::Brush* Renderer::getBrush(SVGElement* shape,
bound.Y = points.first.y - radius.x;
bound.Width = radius.x * 2;
bound.Height = radius.x * 2;
std::cout << bound.X << " " << bound.Y << " " << bound.Width
<< " " << bound.Height << std::endl;
}
Gdiplus::GraphicsPath path;
path.AddEllipse(bound);
Expand All @@ -604,12 +602,7 @@ Gdiplus::Brush* Renderer::getBrush(SVGElement* shape,
stops[stop_size - 2 - i].getColor().r,
stops[stop_size - 2 - i].getColor().g,
stops[stop_size - 2 - i].getColor().b);
offsets[i] = stops[i - 1].getOffset();
std::cout << offsets[i] << " "
<< stops[stop_size - 2 - i].getColor().a << " "
<< stops[stop_size - 2 - i].getColor().r << " "
<< stops[stop_size - 2 - i].getColor().g << " "
<< stops[stop_size - 2 - i].getColor().b << std::endl;
offsets[i] = 1 - stops[stop_size - 2 - i].getOffset();
}
fill->SetInterpolationColors(colors, offsets, stop_size);
applyTransformsOnBrush(gradient->getTransforms(), fill);
Expand Down Expand Up @@ -679,10 +672,6 @@ void Renderer::applyTransformsOnBrush(
sscanf(type.c_str(), "matrix(%f %f %f %f %f %f)", &a, &b, &c, &d,
&e, &f);
Gdiplus::Matrix matrix(a, b, c, d, e, f);
float m[6] = {0};
matrix.GetElements(m);
std::cout << m[0] << " " << m[1] << " " << m[2] << " " << m[3]
<< " " << m[4] << " " << m[5] << std::endl;
brush->SetTransform(&matrix);
}
}
Expand Down

0 comments on commit 9de9781

Please sign in to comment.