зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1074475 - Fix a bug in GetStrokeDashData. r=longsonr
This commit is contained in:
Родитель
f5f620a8d2
Коммит
dc2daaef9e
|
@ -122,10 +122,21 @@ GetStrokeDashData(SVGContentUtils::AutoStrokeOptions* aStrokeOptions,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that aStrokeOptions.mDashPattern is fully initialized we can safely
|
// Now that aStrokeOptions.mDashPattern is fully initialized (we didn't
|
||||||
// set mDashLength:
|
// return early above) we can safely set mDashLength:
|
||||||
aStrokeOptions->mDashLength = dashArrayLength;
|
aStrokeOptions->mDashLength = dashArrayLength;
|
||||||
|
|
||||||
|
if ((dashArrayLength % 2) == 1) {
|
||||||
|
// If we have a dash pattern with an odd number of lengths the pattern
|
||||||
|
// repeats a second time, per the SVG spec., and as implemented by Moz2D.
|
||||||
|
// When deciding whether to return eNoStroke or eContinuousStroke below we
|
||||||
|
// need to take into account that in the repeat pattern the dashes become
|
||||||
|
// gaps, and the gaps become dashes.
|
||||||
|
Float origTotalLengthOfDashes = totalLengthOfDashes;
|
||||||
|
totalLengthOfDashes += totalLengthOfGaps;
|
||||||
|
totalLengthOfGaps += origTotalLengthOfDashes;
|
||||||
|
}
|
||||||
|
|
||||||
if (totalLengthOfDashes <= 0 || totalLengthOfGaps <= 0) {
|
if (totalLengthOfDashes <= 0 || totalLengthOfGaps <= 0) {
|
||||||
if (totalLengthOfGaps > 0 && totalLengthOfDashes <= 0) {
|
if (totalLengthOfGaps > 0 && totalLengthOfDashes <= 0) {
|
||||||
return eNoStroke;
|
return eNoStroke;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче