mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 1122578, part 1 - Make DrawTargetCG::StrokeRect stroke from the same corner and in the same direction as older OS X and other Moz2D backends. r=Bas
This commit is contained in:
parent
dacfb58c19
commit
fc78f23587
@ -1108,7 +1108,19 @@ DrawTargetCG::StrokeRect(const Rect &aRect,
|
||||
DrawGradient(mColorSpace, cg, aPattern, extents);
|
||||
} else {
|
||||
SetStrokeFromPattern(cg, mColorSpace, aPattern);
|
||||
CGContextStrokeRect(cg, RectToCGRect(aRect));
|
||||
// We'd like to use CGContextStrokeRect(cg, RectToCGRect(aRect));
|
||||
// Unfortunately, newer versions of OS X no longer start at the top-left
|
||||
// corner and stroke clockwise as older OS X versions and all the other
|
||||
// Moz2D backends do. (Newer versions start at the top right-hand corner
|
||||
// and stroke counter-clockwise.) For consistency we draw the rect by hand.
|
||||
CGRect rect = RectToCGRect(aRect);
|
||||
CGContextBeginPath(cg);
|
||||
CGContextMoveToPoint(cg, CGRectGetMinX(rect), CGRectGetMinY(rect));
|
||||
CGContextAddLineToPoint(cg, CGRectGetMaxX(rect), CGRectGetMinY(rect));
|
||||
CGContextAddLineToPoint(cg, CGRectGetMaxX(rect), CGRectGetMaxY(rect));
|
||||
CGContextAddLineToPoint(cg, CGRectGetMinX(rect), CGRectGetMaxY(rect));
|
||||
CGContextClosePath(cg);
|
||||
CGContextStrokePath(cg);
|
||||
}
|
||||
|
||||
fixer.Fix(mCg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user