mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 09:19:28 +00:00
Bug 1012860: Explicitly static_cast M_PI to float, to fix MSVC warnings for double-to-float conversion. r=roc
This commit is contained in:
parent
e63fdf5095
commit
aa50397bac
@ -14,20 +14,22 @@ ComputeTransformForRotation(const nsIntRect& aBounds,
|
||||
ScreenRotation aRotation)
|
||||
{
|
||||
gfx::Matrix transform;
|
||||
static const gfx::Float floatPi = static_cast<gfx::Float>(M_PI);
|
||||
|
||||
switch (aRotation) {
|
||||
case ROTATION_0:
|
||||
break;
|
||||
case ROTATION_90:
|
||||
transform.Translate(aBounds.width, 0);
|
||||
transform = gfx::Matrix::Rotation(M_PI / 2) * transform;
|
||||
transform = gfx::Matrix::Rotation(floatPi / 2) * transform;
|
||||
break;
|
||||
case ROTATION_180:
|
||||
transform.Translate(aBounds.width, aBounds.height);
|
||||
transform = gfx::Matrix::Rotation(M_PI) * transform;
|
||||
transform = gfx::Matrix::Rotation(floatPi) * transform;
|
||||
break;
|
||||
case ROTATION_270:
|
||||
transform.Translate(0, aBounds.height);
|
||||
transform = gfx::Matrix::Rotation(M_PI * 3 / 2) * transform;
|
||||
transform = gfx::Matrix::Rotation(floatPi * 3 / 2) * transform;
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unknown rotation");
|
||||
|
Loading…
x
Reference in New Issue
Block a user