mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Ensure square list bullets are always square. (Bug 376690) r=roc
This commit is contained in:
parent
5b003deb87
commit
3a70c2f304
@ -273,9 +273,25 @@ nsBulletFrame::PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt,
|
||||
break;
|
||||
|
||||
case NS_STYLE_LIST_STYLE_SQUARE:
|
||||
aRenderingContext.FillRect(mPadding.left + aPt.x, mPadding.top + aPt.y,
|
||||
mRect.width - (mPadding.left + mPadding.right),
|
||||
mRect.height - (mPadding.top + mPadding.bottom));
|
||||
{
|
||||
nsRect rect(mPadding.TopLeft() + aPt,
|
||||
nsSize(mRect.width - mPadding.LeftRight(),
|
||||
mRect.height - mPadding.TopBottom()));
|
||||
// Snap the height and the width of the rectangle to device pixels,
|
||||
// and then center the result within the original rectangle, so that
|
||||
// all square bullets at the same font size have the same visual
|
||||
// size (bug 376690).
|
||||
// FIXME: We should really only do this if we're not transformed
|
||||
// (like gfxContext::UserToDevicePixelSnapped does).
|
||||
nsPresContext *pc = PresContext();
|
||||
nsRect snapRect(rect.x, rect.y,
|
||||
pc->RoundAppUnitsToNearestDevPixels(rect.width),
|
||||
pc->RoundAppUnitsToNearestDevPixels(rect.height));
|
||||
snapRect.MoveBy((rect.width - snapRect.width) / 2,
|
||||
(rect.height - snapRect.height) / 2);
|
||||
aRenderingContext.FillRect(snapRect.x, snapRect.y,
|
||||
snapRect.width, snapRect.height);
|
||||
}
|
||||
break;
|
||||
|
||||
case NS_STYLE_LIST_STYLE_DECIMAL:
|
||||
|
Loading…
Reference in New Issue
Block a user