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)
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().
| Reporter | ||
Comment 1•12 years ago
|
||
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.
Updated•3 years ago
|
Severity: normal → S3
Comment 2•8 months ago
|
||
Updated•8 months ago
|
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Comment 3•8 months ago
|
||
Updated•7 months ago
|
Attachment #9496010 -
Attachment is obsolete: true
Comment 4•7 months ago
|
||
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
Updated•7 months ago
|
Resolution: FIXED → WONTFIX
Updated•7 months ago
|
Assignee: longsonr → nobody
You need to log in
before you can comment on or make changes to this bug.
Description
•