| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 bool RotateTransformOperation::shareSameAxis(const RotateTransformOperation* fro
m, const RotateTransformOperation* to, FloatPoint3D* axis, double* fromAngle, do
uble* toAngle) | 39 bool RotateTransformOperation::shareSameAxis(const RotateTransformOperation* fro
m, const RotateTransformOperation* to, FloatPoint3D* axis, double* fromAngle, do
uble* toAngle) |
| 40 { | 40 { |
| 41 *axis = FloatPoint3D(0, 0, 1); | 41 *axis = FloatPoint3D(0, 0, 1); |
| 42 *fromAngle = 0; | 42 *fromAngle = 0; |
| 43 *toAngle = 0; | 43 *toAngle = 0; |
| 44 | 44 |
| 45 if (!from && !to) | 45 if (!from && !to) |
| 46 return true; | 46 return true; |
| 47 | 47 |
| 48 bool fromZero = !from || from->axis().isZero(); | 48 bool fromZero = !from || from->axis().isZero() || fabs(from->angle()) < angl
eEpsilon; |
| 49 bool toZero = !to || to->axis().isZero(); | 49 bool toZero = !to || to->axis().isZero() || fabs(to->angle()) < angleEpsilon
; |
| 50 | 50 |
| 51 if (fromZero && toZero) | 51 if (fromZero && toZero) |
| 52 return true; | 52 return true; |
| 53 | 53 |
| 54 if (fromZero) { | 54 if (fromZero) { |
| 55 *axis = to->axis(); | 55 *axis = to->axis(); |
| 56 *toAngle = to->angle(); | 56 *toAngle = to->angle(); |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 return RotateTransformOperation::create(x, y, z, angle, Rotate3D); | 151 return RotateTransformOperation::create(x, y, z, angle, Rotate3D); |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool RotateTransformOperation::canBlendWith(const TransformOperation& other) con
st | 154 bool RotateTransformOperation::canBlendWith(const TransformOperation& other) con
st |
| 155 { | 155 { |
| 156 return other.isSameType(*this); | 156 return other.isSameType(*this); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace blink | 159 } // namespace blink |
| OLD | NEW |