common linear_gradient: fix to allow zero size linear.

We can't judge zero size gradient is error case.
Non-filled linear is possibly intended by calculation.
This commit is contained in:
Hermet Park 2021-07-04 01:36:51 +09:00
parent a5d2950902
commit 15d6a51527

View file

@ -67,9 +67,6 @@ LinearGradient::~LinearGradient()
Result LinearGradient::linear(float x1, float y1, float x2, float y2) noexcept Result LinearGradient::linear(float x1, float y1, float x2, float y2) noexcept
{ {
if (fabsf(x2 - x1) < FLT_EPSILON && fabsf(y2 - y1) < FLT_EPSILON)
return Result::InvalidArguments;
pImpl->x1 = x1; pImpl->x1 = x1;
pImpl->y1 = y1; pImpl->y1 = y1;
pImpl->x2 = x2; pImpl->x2 = x2;