Closed Bug 668315 Opened 14 years ago Closed 7 months ago

SMILIntegerType::Interpolate should use NS_lround instead of re-implementing rounding

Categories

(Core :: SVG, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dholbert, Unassigned)

Details

Attachments

(1 obsolete file)

SMILIntegerType::Interpolate has some manual round-to-nearest int code that I think can be replaced with a call to NS_lround().
Specifically: 86 // When currentVal is exactly midway between its two nearest integers, we 87 // jump to the "next" integer to provide simple, easy to remember and 88 // consistent behaviour (from the SMIL author's point of view). 89 90 if (startVal < endVal) { 91 aResult.mU.mInt = int64_t(floor(currentVal + 0.5)); // round mid up 92 } else { 93 aResult.mU.mInt = int64_t(ceil(currentVal - 0.5)); // round mid down 94 } http://mxr.mozilla.org/mozilla-central/source/content/smil/SMILIntegerType.cpp#86 Though note that NS_lround returns a 32-bit int, not a 64-bit int, so it may not be appropriate here after all.
Severity: normal → S3
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Attachment #9496010 - Attachment is obsolete: true

The standard library only rounds in one direction so it's not going to be simpler than the code we have now.

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Resolution: FIXED → WONTFIX
Assignee: longsonr → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: