OLD | NEW |
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 case BasicShape::BasicShapeInsetType: { | 228 case BasicShape::BasicShapeInsetType: { |
229 const BasicShapeInset& inset = *static_cast<const BasicShapeInset*>(basi
cShape); | 229 const BasicShapeInset& inset = *static_cast<const BasicShapeInset*>(basi
cShape); |
230 float left = floatValueForLength(inset.left(), boxWidth); | 230 float left = floatValueForLength(inset.left(), boxWidth); |
231 float top = floatValueForLength(inset.top(), boxHeight); | 231 float top = floatValueForLength(inset.top(), boxHeight); |
232 float right = floatValueForLength(inset.right(), boxWidth); | 232 float right = floatValueForLength(inset.right(), boxWidth); |
233 float bottom = floatValueForLength(inset.bottom(), boxHeight); | 233 float bottom = floatValueForLength(inset.bottom(), boxHeight); |
234 FloatRect rect(left, top, std::max<float>(boxWidth - left - right, 0), s
td::max<float>(boxHeight - top - bottom, 0)); | 234 FloatRect rect(left, top, std::max<float>(boxWidth - left - right, 0), s
td::max<float>(boxHeight - top - bottom, 0)); |
235 FloatRect logicalRect = physicalRectToLogical(rect, logicalBoxSize.heigh
t(), writingMode); | 235 FloatRect logicalRect = physicalRectToLogical(rect, logicalBoxSize.heigh
t(), writingMode); |
236 | 236 |
237 FloatSize boxSize(boxWidth, boxHeight); | 237 FloatSize boxSize(boxWidth, boxHeight); |
238 FloatRoundedRect::Radii cornerRadii( | 238 FloatSize topLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(i
nset.topLeftRadius(), boxSize), writingMode); |
239 floatSizeForLengthSize(inset.topLeftRadius(), boxSize), | 239 FloatSize topRightRadius = physicalSizeToLogical(floatSizeForLengthSize(
inset.topRightRadius(), boxSize), writingMode); |
240 floatSizeForLengthSize(inset.topRightRadius(), boxSize), | 240 FloatSize bottomLeftRadius = physicalSizeToLogical(floatSizeForLengthSiz
e(inset.bottomLeftRadius(), boxSize), writingMode); |
241 floatSizeForLengthSize(inset.bottomLeftRadius(), boxSize), | 241 FloatSize bottomRightRadius = physicalSizeToLogical(floatSizeForLengthSi
ze(inset.bottomRightRadius(), boxSize), writingMode); |
242 floatSizeForLengthSize(inset.bottomRightRadius(), boxSize)); | 242 FloatRoundedRect::Radii cornerRadii(topLeftRadius, topRightRadius, botto
mLeftRadius, bottomRightRadius); |
243 | 243 |
244 shape = createInsetShape(FloatRoundedRect(logicalRect, cornerRadii)); | 244 shape = createInsetShape(FloatRoundedRect(logicalRect, cornerRadii)); |
245 break; | 245 break; |
246 } | 246 } |
247 | 247 |
248 default: | 248 default: |
249 ASSERT_NOT_REACHED(); | 249 ASSERT_NOT_REACHED(); |
250 } | 250 } |
251 | 251 |
252 shape->m_writingMode = writingMode; | 252 shape->m_writingMode = writingMode; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 FloatRoundedRect bounds(rect, roundedRect.radii()); | 304 FloatRoundedRect bounds(rect, roundedRect.radii()); |
305 OwnPtr<Shape> shape = createInsetShape(bounds); | 305 OwnPtr<Shape> shape = createInsetShape(bounds); |
306 shape->m_writingMode = writingMode; | 306 shape->m_writingMode = writingMode; |
307 shape->m_margin = floatValueForLength(margin, 0); | 307 shape->m_margin = floatValueForLength(margin, 0); |
308 shape->m_padding = floatValueForLength(padding, 0); | 308 shape->m_padding = floatValueForLength(padding, 0); |
309 | 309 |
310 return shape.release(); | 310 return shape.release(); |
311 } | 311 } |
312 | 312 |
313 } // namespace WebCore | 313 } // namespace WebCore |
OLD | NEW |