Bug 367209 - getBBox() returns ((0,0), (0,0)) on two point polyline. r+sr=tor
git-svn-id: svn://10.0.0.236/trunk@218744 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -411,13 +411,16 @@ nsSVGPathGeometryFrame::UpdateCoveredRegion()
|
||||
if (HasStroke()) {
|
||||
SetupCairoStrokeGeometry(&context);
|
||||
cairo_stroke_extents(ctx, &xmin, &ymin, &xmax, &ymax);
|
||||
nsSVGUtils::UserToDeviceBBox(ctx, &xmin, &ymin, &xmax, &ymax);
|
||||
if (!IsDegeneratePath(xmin, ymin, xmax, ymax)) {
|
||||
nsSVGUtils::UserToDeviceBBox(ctx, &xmin, &ymin, &xmax, &ymax);
|
||||
mRect = nsSVGUtils::ToBoundingPixelRect(xmin, ymin, xmax, ymax);
|
||||
}
|
||||
} else {
|
||||
cairo_identity_matrix(ctx);
|
||||
cairo_fill_extents(ctx, &xmin, &ymin, &xmax, &ymax);
|
||||
if (!IsDegeneratePath(xmin, ymin, xmax, ymax))
|
||||
mRect = nsSVGUtils::ToBoundingPixelRect(xmin, ymin, xmax, ymax);
|
||||
}
|
||||
if (!IsDegeneratePath(xmin, ymin, xmax, ymax))
|
||||
mRect = nsSVGUtils::ToBoundingPixelRect(xmin, ymin, xmax, ymax);
|
||||
|
||||
// Add in markers
|
||||
mRect = GetCoveredRegion();
|
||||
|
||||
@@ -130,18 +130,17 @@ private:
|
||||
/*
|
||||
* Check for what cairo returns for the fill extents of a degenerate path
|
||||
*
|
||||
* @param xmin the minimum x value in device units
|
||||
* @param ymin the minimum y value in device units
|
||||
* @param xmax the maximum x value in device units
|
||||
* @param ymax the maximum y value in device units
|
||||
* @param xmin the minimum x value in user units
|
||||
* @param ymin the minimum y value in user units
|
||||
* @param xmax the maximum x value in user units
|
||||
* @param ymax the maximum y value in user units
|
||||
*
|
||||
* @return PR_TRUE if the path is degenerate
|
||||
*/
|
||||
static PRBool
|
||||
IsDegeneratePath(double xmin, double ymin, double xmax, double ymax)
|
||||
{
|
||||
return (fabs(xmin - 32767) < 1 && fabs(ymin - 32767) < 1 &&
|
||||
fabs(xmax + 32768) < 1 && fabs(ymax + 32768) < 1);
|
||||
return (xmin == 0 && ymin == 0 && xmax == 0 && ymax == 0);
|
||||
}
|
||||
|
||||
nsSVGMarkerProperty *GetMarkerProperty();
|
||||
|
||||
Reference in New Issue
Block a user