Open Bug 981617 Opened 12 years ago Updated 1 year ago

"Rounded" methods in Units.h should specify how they round

Categories

(Core :: Layout, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: roc, Unassigned)

Details

Attachments

(1 file)

Otherwise it can be confusing, since there are different rounding methods. In particular, in other places we call ToNearest. Also, it's pretty much always wrong to round a rectangle by rounding its x/y/width/height independently.
Comment on attachment 8388492 [details] [diff] [review] Part 1: Rename CSSPixel::FromAppUnitsRounded to FromAppUnitsToNearest Review of attachment 8388492 [details] [diff] [review]: ----------------------------------------------------------------- r=me with comment fixed Also, can you change the two call sites to CSSIntRect::FromAppUnitsRounded in nsGlobalWindow.cpp to be CSSIntSize::FromAppUnitsRounded? It's misleading that they're called on CSSIntRect when in fact they deal with size properties. ::: layout/base/Units.h @@ +75,5 @@ > */ > struct CSSPixel { > > + static CSSIntRect FromUntyped(const nsIntRect& aPoint) { > + return CSSIntRect(aPoint.x, aPoint.y, aPoint.width, aPoint.height); s/aPoint/aRect/g
Attachment #8388492 - Flags: review?(bugmail.mozilla) → review+
Assignee: roc → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: