Changeset 28714 in webkit
- Timestamp:
- Dec 14, 2007, 11:37:12 AM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r28711 r28714 1 2007-12-14 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 - fix <rdar://problem/5643663> text-shadow and box-shadow offsets 1px smaller than specified 6 which is the root cause of: 7 http://bugs.webkit.org/show_bug.cgi?id=12943 8 box-shadow: small values don't affect shadow position 9 http://bugs.webkit.org/show_bug.cgi?id=14736 10 Safari implementation of text-shadow off by 1px 11 12 * platform/graphics/cg/GraphicsContextCG.cpp: 13 (WebCore::GraphicsContext::setShadow): Slightly increase the magnitude 14 of the offsets passed to CGContextSetShadow* to ensure that the end 15 result after truncation is the desired integer offsets. 16 1 17 2007-12-13 Alp Toker <alp@atoker.com> 2 18 -
trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r28588 r28714 31 31 32 32 #include "AffineTransform.h" 33 #include "FloatConversion.h" 33 34 #include "GraphicsContextPlatformPrivate.h" 34 35 #include "KURL.h" … … 510 511 if (paintingDisabled()) 511 512 return; 513 CGContextRef context = platformContext(); 514 515 CGFloat width = size.width(); 516 CGFloat height = size.height(); 517 518 #if PLATFORM(MAC) 519 // Work around <rdar://problem/5539388> by ensuring that the offsets will get truncated 520 // to the desired integer. 521 // FIXME: This is not needed post-Leopard. 522 static const CGFloat extraShadowOffset = narrowPrecisionToCGFloat(1.0 / 128); 523 if (width > 0) 524 width += extraShadowOffset; 525 else if (width < 0) 526 width -= extraShadowOffset; 527 528 if (height > 0) 529 height += extraShadowOffset; 530 else if (height < 0) 531 height -= extraShadowOffset; 532 #endif 533 512 534 // Check for an invalid color, as this means that the color was not set for the shadow 513 535 // and we should therefore just use the default shadow color. 514 CGContextRef context = platformContext();515 536 if (!color.isValid()) 516 CGContextSetShadow(context, CGSizeMake( size.width(), -size.height()), blur); // y is flipped.537 CGContextSetShadow(context, CGSizeMake(width, -height), blur); // y is flipped. 517 538 else { 518 539 CGColorRef colorCG = cgColor(color); 519 540 CGContextSetShadowWithColor(context, 520 CGSizeMake( size.width(), -size.height()), // y is flipped.541 CGSizeMake(width, -height), // y is flipped. 521 542 blur, 522 543 colorCG);
Note:
See TracChangeset
for help on using the changeset viewer.