[Webkit-unassigned] [Bug 52509] Shadow is not shown when using strokeRect with a gradient strokeStyle
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 3 16:27:44 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=52509
--- Comment #8 from Simon Fraser (smfr) <simon.fraser at apple.com> 2011-02-03 16:27:44 PST ---
(From update of attachment 81121)
View in context: https://bugs.webkit.org/attachment.cgi?id=81121&action=review
> Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:988
> + // Compensate for half of the line width, otherwise the layer's top-left corner would
> + // be aligned with the rect's top-left corner, not considering the line width. This
> + // would result in leaving half of the line out of the layer on the left and top sides.
> + const float translationX = halfLineWidth - rect.x();
> + const float translationY = halfLineWidth - rect.y();
> + CGContextTranslateCTM(layerContext, translationX, translationY);
> +
> + CGContextAddRect(layerContext, rect);
> + CGContextReplacePathWithStrokedPath(layerContext);
> + CGContextClip(layerContext);
> + CGContextConcatCTM(layerContext, m_state.strokeGradient->gradientSpaceTransform());
> + m_state.strokeGradient->paint(layerContext);
> +
> + const float destinationX = rect.x() - halfLineWidth;
> + const float destinationY = rect.y() - halfLineWidth;
> + CGContextDrawLayerAtPoint(context, CGPointMake(destinationX, destinationY), layer);
I think you want to avoid drawing the layer at half-pixel offsets. Why not just round out the layer size to a whole pixel?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list