зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1326407 Part 4 - Extract a function to convert a rect to float manager's logical coordinate. r=dbaron
MozReview-Commit-ID: Ag6V6XmlHIU --HG-- extra : rebase_source : e47c6673a22c9e2de595e86a519c927546f68a96
This commit is contained in:
Родитель
be522fca9a
Коммит
80b589bbdc
|
@ -650,10 +650,8 @@ nsFloatManager::FloatInfo::FloatInfo(nsIFrame* aFrame,
|
|||
WritingMode aWM,
|
||||
const nsSize& aContainerSize)
|
||||
: mFrame(aFrame)
|
||||
, mRect(aMarginRect.LineLeft(aWM, aContainerSize) + aLineLeft,
|
||||
aMarginRect.BStart(aWM) + aBlockStart,
|
||||
aMarginRect.ISize(aWM),
|
||||
aMarginRect.BSize(aWM))
|
||||
, mRect(ShapeInfo::ConvertToFloatLogical(aMarginRect, aWM, aContainerSize) +
|
||||
nsPoint(aLineLeft, aBlockStart))
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsFloatManager::FloatInfo);
|
||||
|
||||
|
@ -675,10 +673,8 @@ nsFloatManager::FloatInfo::FloatInfo(nsIFrame* aFrame,
|
|||
ShapeInfo::ComputeShapeBoxRect(shapeOutside, mFrame, aMarginRect, aWM);
|
||||
|
||||
if (shapeOutside.GetType() == StyleShapeSourceType::Box) {
|
||||
nsRect rect(shapeBoxRect.LineLeft(aWM, aContainerSize),
|
||||
shapeBoxRect.BStart(aWM),
|
||||
shapeBoxRect.ISize(aWM),
|
||||
shapeBoxRect.BSize(aWM));
|
||||
nsRect rect = ShapeInfo::ConvertToFloatLogical(shapeBoxRect, aWM,
|
||||
aContainerSize);
|
||||
mShapeInfo = MakeUnique<BoxShapeInfo>(rect, mFrame);
|
||||
} else if (shapeOutside.GetType() == StyleShapeSourceType::Shape) {
|
||||
StyleBasicShape* const basicShape = shapeOutside.GetBasicShape();
|
||||
|
|
|
@ -367,6 +367,16 @@ private:
|
|||
const mozilla::LogicalRect& aMarginRect,
|
||||
mozilla::WritingMode aWM);
|
||||
|
||||
// Convert the LogicalRect to the special logical coordinate space used
|
||||
// in float manager.
|
||||
static nsRect ConvertToFloatLogical(const mozilla::LogicalRect& aRect,
|
||||
mozilla::WritingMode aWM,
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
return nsRect(aRect.LineLeft(aWM, aContainerSize), aRect.BStart(aWM),
|
||||
aRect.ISize(aWM), aRect.BSize(aWM));
|
||||
}
|
||||
|
||||
static mozilla::UniquePtr<ShapeInfo> CreateCircleOrEllipse(
|
||||
mozilla::StyleBasicShape* const aBasicShape,
|
||||
const mozilla::LogicalRect& aShapeBoxRect,
|
||||
|
|
Загрузка…
Ссылка в новой задаче