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, 2009, 2010 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 bool applyTransformOrigin = | 1261 bool applyTransformOrigin = |
1262 requireTransformOrigin(applyOrigin, applyMotionPath); | 1262 requireTransformOrigin(applyOrigin, applyMotionPath); |
1263 | 1263 |
1264 float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0; | 1264 float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0; |
1265 float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0; | 1265 float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0; |
1266 | 1266 |
1267 float originX = 0; | 1267 float originX = 0; |
1268 float originY = 0; | 1268 float originY = 0; |
1269 float originZ = 0; | 1269 float originZ = 0; |
1270 | 1270 |
1271 if (applyTransformOrigin) { | 1271 if (applyTransformOrigin || |
| 1272 // We need to calculate originX and originY for applying motion path. |
| 1273 applyMotionPath == ComputedStyle::IncludeMotionPath) { |
1272 originX = | 1274 originX = |
1273 floatValueForLength(transformOriginX(), boundingBox.width()) + offsetX; | 1275 floatValueForLength(transformOriginX(), boundingBox.width()) + offsetX; |
1274 originY = | 1276 originY = |
1275 floatValueForLength(transformOriginY(), boundingBox.height()) + offsetY; | 1277 floatValueForLength(transformOriginY(), boundingBox.height()) + offsetY; |
1276 originZ = transformOriginZ(); | 1278 if (applyTransformOrigin) { |
1277 result.translate3d(originX, originY, originZ); | 1279 originZ = transformOriginZ(); |
| 1280 result.translate3d(originX, originY, originZ); |
| 1281 } |
1278 } | 1282 } |
1279 | 1283 |
1280 if (applyIndependentTransformProperties == | 1284 if (applyIndependentTransformProperties == |
1281 IncludeIndependentTransformProperties) { | 1285 IncludeIndependentTransformProperties) { |
1282 if (translate()) | 1286 if (translate()) |
1283 translate()->apply(result, boundingBox.size()); | 1287 translate()->apply(result, boundingBox.size()); |
1284 | 1288 |
1285 if (rotate()) | 1289 if (rotate()) |
1286 rotate()->apply(result, boundingBox.size()); | 1290 rotate()->apply(result, boundingBox.size()); |
1287 | 1291 |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 if (value < 0) | 2314 if (value < 0) |
2311 fvalue -= 0.5f; | 2315 fvalue -= 0.5f; |
2312 else | 2316 else |
2313 fvalue += 0.5f; | 2317 fvalue += 0.5f; |
2314 } | 2318 } |
2315 | 2319 |
2316 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2320 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
2317 } | 2321 } |
2318 | 2322 |
2319 } // namespace blink | 2323 } // namespace blink |
OLD | NEW |