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

Side by Side Diff: Source/core/css/BasicShapeFunctions.cpp

Issue 115253003: Layout support for new circle shape syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use FloatSize/FloatPoint's more Created 6 years, 11 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
« no previous file with comments | « Source/core/css/BasicShapeFunctions.h ('k') | Source/core/rendering/shapes/Shape.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 349 }
350 default: 350 default:
351 break; 351 break;
352 } 352 }
353 353
354 if (basicShapeValue->layoutBox()) 354 if (basicShapeValue->layoutBox())
355 basicShape->setLayoutBox(LayoutBox(*basicShapeValue->layoutBox())); 355 basicShape->setLayoutBox(LayoutBox(*basicShapeValue->layoutBox()));
356 356
357 return basicShape.release(); 357 return basicShape.release();
358 } 358 }
359
360 FloatPoint floatPointForCenterCoordinate(const BasicShapeCenterCoordinate& cente rX, const BasicShapeCenterCoordinate& centerY, FloatSize boxSize)
361 {
362 FloatPoint p;
363 float offset = floatValueForLength(centerX.length(), boxSize.width());
364 switch (centerX.keyword()) {
leviw_travelin_and_unemployed 2014/01/08 23:07:43 I guess what I was imagining was this single acces
365 case BasicShapeCenterCoordinate::None:
366 case BasicShapeCenterCoordinate::Left:
367 p.setX(offset);
368 break;
369 case BasicShapeCenterCoordinate::Right:
370 p.setX(boxSize.width() - offset);
371 break;
372 default:
373 ASSERT_NOT_REACHED();
374 }
375
376 offset = floatValueForLength(centerY.length(), boxSize.height());
377 switch (centerY.keyword()) {
378 case BasicShapeCenterCoordinate::None:
379 case BasicShapeCenterCoordinate::Top:
380 p.setY(offset);
381 break;
382 case BasicShapeCenterCoordinate::Bottom:
383 p.setY(boxSize.height() - offset);
384 break;
385 default:
386 ASSERT_NOT_REACHED();
387 }
388
389 return p;
359 } 390 }
391
392 }
OLDNEW
« no previous file with comments | « Source/core/css/BasicShapeFunctions.h ('k') | Source/core/rendering/shapes/Shape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698