Closed
Bug 1429605
Opened 8 years ago
Closed 7 years ago
Simplify rect.Inflate(someLength, someLength) calls to use single-param version
Categories
(Core :: Layout, enhancement, P5)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla68
People
(Reporter: dholbert, Assigned: u480271)
Details
Attachments
(2 files)
BaseRect has a convenience "Inflate()" method that takes a single arg and then calls the 2-arg version:
> void Inflate(T aD) { Inflate(aD, aD); }
> void Inflate(T aDx, T aDy)
> {
> x -= aDx;
> y -= aDy;
> width += 2 * aDx;
> height += 2 * aDy;
> }
https://dxr.mozilla.org/mozilla-central/rev/c38d22170d6f27e94c3c53093215d20255fab27a/gfx/2d/BaseRect.h#267
So any call of the form...
r.Inflate(foo, foo);
...could really be simplified to just:
r.Inflate(foo);
Filing this bug to do cleanup of this sort. I found one place in the code in nsMathMLChar::PaintVertically while doing a code-review in bug 1424382:
> unionRect.Inflate(oneDevPixel, oneDevPixel);
https://dxr.mozilla.org/mozilla-central/rev/c38d22170d6f27e94c3c53093215d20255fab27a/layout/mathml/nsMathMLChar.cpp#2209
...but I assume there are more.
MozReview-Commit-ID: BP8Vm6eL0zg
Attachment #8970423 -
Flags: review?(dholbert)
Reporter | ||
Comment 2•7 years ago
|
||
Comment on attachment 8970423 [details] [diff] [review]
Use single-param version of rect.Inflate when x == y. r?dholbert
Review of attachment 8970423 [details] [diff] [review]:
-----------------------------------------------------------------
r=me
Attachment #8970423 -
Flags: review?(dholbert) → review+
Comment 3•7 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:kamidphish, could you have a look please?
Flags: needinfo?(dglastonbury)
Assignee: nobody → dglastonbury
Flags: needinfo?(dglastonbury)
Pushed by dglastonbury@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5e2f12439dca
Use single-param version of rect.Inflate when x == y. r=dholbert
Comment 6•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox68:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Comment 7•7 years ago
|
||
https://hg.mozilla.org/projects/ash/rev/5e2f12439dca9c25f6f42245be8c7929a1ce66aa
Bug 1429605 - Use single-param version of rect.Inflate when x == y. r=dholbert
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•