Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 else if (m_align == kSvgPreserveaspectratioXmidymin || 329 else if (m_align == kSvgPreserveaspectratioXmidymin ||
330 m_align == kSvgPreserveaspectratioXmidymid || 330 m_align == kSvgPreserveaspectratioXmidymid ||
331 m_align == kSvgPreserveaspectratioXmidymax) 331 m_align == kSvgPreserveaspectratioXmidymax)
332 transform.translate(-extendedLogicalX - 332 transform.translate(-extendedLogicalX -
333 (extendedLogicalWidth - 333 (extendedLogicalWidth -
334 extendedPhysicalWidth * extendedLogicalHeight / 334 extendedPhysicalWidth * extendedLogicalHeight /
335 extendedPhysicalHeight) / 335 extendedPhysicalHeight) /
336 2, 336 2,
337 -extendedLogicalY); 337 -extendedLogicalY);
338 else 338 else
339 transform.translate( 339 transform.translate(-extendedLogicalX -
340 -extendedLogicalX - (extendedLogicalWidth - 340 (extendedLogicalWidth -
341 extendedPhysicalWidth * extendedLogicalHeight / 341 extendedPhysicalWidth * extendedLogicalHeight /
342 extendedPhysicalHeight), 342 extendedPhysicalHeight),
343 -extendedLogicalY); 343 -extendedLogicalY);
344 344
345 return transform; 345 return transform;
346 } 346 }
347 347
348 transform.scaleNonUniform(extendedPhysicalWidth / extendedLogicalWidth, 348 transform.scaleNonUniform(extendedPhysicalWidth / extendedLogicalWidth,
349 extendedPhysicalWidth / extendedLogicalWidth); 349 extendedPhysicalWidth / extendedLogicalWidth);
350 350
351 if (m_align == kSvgPreserveaspectratioXminymin || 351 if (m_align == kSvgPreserveaspectratioXminymin ||
352 m_align == kSvgPreserveaspectratioXmidymin || 352 m_align == kSvgPreserveaspectratioXmidymin ||
353 m_align == kSvgPreserveaspectratioXmaxymin) 353 m_align == kSvgPreserveaspectratioXmaxymin)
354 transform.translate(-extendedLogicalX, -extendedLogicalY); 354 transform.translate(-extendedLogicalX, -extendedLogicalY);
355 else if (m_align == kSvgPreserveaspectratioXminymid || 355 else if (m_align == kSvgPreserveaspectratioXminymid ||
356 m_align == kSvgPreserveaspectratioXmidymid || 356 m_align == kSvgPreserveaspectratioXmidymid ||
357 m_align == kSvgPreserveaspectratioXmaxymid) 357 m_align == kSvgPreserveaspectratioXmaxymid)
358 transform.translate(-extendedLogicalX, 358 transform.translate(-extendedLogicalX,
359 -extendedLogicalY - 359 -extendedLogicalY -
360 (extendedLogicalHeight - 360 (extendedLogicalHeight -
361 extendedPhysicalHeight * extendedLogicalWidth / 361 extendedPhysicalHeight * extendedLogicalWidth /
362 extendedPhysicalWidth) / 362 extendedPhysicalWidth) /
363 2); 363 2);
364 else 364 else
365 transform.translate( 365 transform.translate(-extendedLogicalX,
366 -extendedLogicalX, 366 -extendedLogicalY -
367 -extendedLogicalY - (extendedLogicalHeight - 367 (extendedLogicalHeight -
368 extendedPhysicalHeight * extendedLogicalWidth / 368 extendedPhysicalHeight * extendedLogicalWidth /
369 extendedPhysicalWidth)); 369 extendedPhysicalWidth));
370 370
371 return transform; 371 return transform;
372 } 372 }
373 373
374 String SVGPreserveAspectRatio::valueAsString() const { 374 String SVGPreserveAspectRatio::valueAsString() const {
375 StringBuilder builder; 375 StringBuilder builder;
376 376
377 const char* alignString = ""; 377 const char* alignString = "";
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice; 453 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice;
454 } 454 }
455 455
456 float SVGPreserveAspectRatio::calculateDistance(SVGPropertyBase* toValue, 456 float SVGPreserveAspectRatio::calculateDistance(SVGPropertyBase* toValue,
457 SVGElement* contextElement) { 457 SVGElement* contextElement) {
458 // No paced animations for SVGPreserveAspectRatio. 458 // No paced animations for SVGPreserveAspectRatio.
459 return -1; 459 return -1;
460 } 460 }
461 461
462 } // namespace blink 462 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp ('k') | third_party/WebKit/Source/core/svg/SVGStringList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698