| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 { | 84 { |
| 85 if (from && !from->isSameType(*this)) | 85 if (from && !from->isSameType(*this)) |
| 86 return this; | 86 return this; |
| 87 | 87 |
| 88 if (blendToIdentity) | 88 if (blendToIdentity) |
| 89 return RotateTransformOperation::create(m_x, m_y, m_z, m_angle - m_angle
* progress, m_type); | 89 return RotateTransformOperation::create(m_x, m_y, m_z, m_angle - m_angle
* progress, m_type); |
| 90 | 90 |
| 91 const RotateTransformOperation* fromOp = static_cast<const RotateTransformOp
eration*>(from); | 91 const RotateTransformOperation* fromOp = static_cast<const RotateTransformOp
eration*>(from); |
| 92 | 92 |
| 93 // Optimize for single axis rotation | 93 // Optimize for single axis rotation |
| 94 if (!fromOp || (fromOp->m_x == 0 && fromOp->m_y == 0 && fromOp->m_z == 1) || | 94 if (!fromOp) { |
| 95 (fromOp->m_x == 0 && fromOp->m_y == 1 && fromOp->m_z == 0) || | |
| 96 (fromOp->m_x == 1 && fromOp->m_y == 0 && fromOp->m_z == 0)) { | |
| 97 double fromAngle = fromOp ? fromOp->m_angle : 0; | 95 double fromAngle = fromOp ? fromOp->m_angle : 0; |
| 98 return RotateTransformOperation::create(fromOp ? fromOp->m_x : m_x, | 96 return RotateTransformOperation::create(fromOp ? fromOp->m_x : m_x, |
| 99 fromOp ? fromOp->m_y : m_y, | 97 fromOp ? fromOp->m_y : m_y, |
| 100 fromOp ? fromOp->m_z : m_z, | 98 fromOp ? fromOp->m_z : m_z, |
| 101 blink::blend(fromAngle, m_angle,
progress), m_type); | 99 blink::blend(fromAngle, m_angle,
progress), m_type); |
| 102 } | 100 } |
| 103 double fromAngle; | 101 double fromAngle; |
| 104 double toAngle; | 102 double toAngle; |
| 105 FloatPoint3D axis; | 103 FloatPoint3D axis; |
| 106 | 104 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 150 } |
| 153 return RotateTransformOperation::create(x, y, z, angle, Rotate3D); | 151 return RotateTransformOperation::create(x, y, z, angle, Rotate3D); |
| 154 } | 152 } |
| 155 | 153 |
| 156 bool RotateTransformOperation::canBlendWith(const TransformOperation& other) con
st | 154 bool RotateTransformOperation::canBlendWith(const TransformOperation& other) con
st |
| 157 { | 155 { |
| 158 return other.isSameType(*this); | 156 return other.isSameType(*this); |
| 159 } | 157 } |
| 160 | 158 |
| 161 } // namespace blink | 159 } // namespace blink |
| OLD | NEW |