mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 06:51:01 +01:00
[hvgl] Optimize away complex math
Most of the time rotation is zero. It's the same test.
This commit is contained in:
1 parent
25ed2c195e
commit
93f0dd97ba
1 file changed
+3
-3
@@ -290,10 +290,10 @@ PartComposite::apply_transforms (hb_array_t<hb_transform_t> transforms,
|
||||
|
||||
hb_transform_t scaled_extremum_transform;
|
||||
|
||||
std::complex<float> t {extremum_translation_delta.x, extremum_translation_delta.y};
|
||||
std::complex<float> _1_minus_e_iangle = 1.f - std::exp (std::complex<float> (0, 1) * (float) extremum_rotation_delta);
|
||||
if (_1_minus_e_iangle != 0.f)
|
||||
if (extremum_rotation_delta)
|
||||
{
|
||||
std::complex<float> t {extremum_translation_delta.x, extremum_translation_delta.y};
|
||||
std::complex<float> _1_minus_e_iangle = 1.f - std::exp (std::complex<float> (0, 1) * (float) extremum_rotation_delta);
|
||||
std::complex<float> eigen = t / _1_minus_e_iangle;
|
||||
float eigen_x = eigen.real ();
|
||||
float eigen_y = eigen.imag ();
|
||||
|
||||
Reference in new issue
Block a user