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)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox59 --- wontfix
firefox68 --- fixed

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)
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+

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
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: