Skip to content

Commit

Permalink
[embedlite] Update width and height based on margins. Contributes to …
Browse files Browse the repository at this point in the history
…JB#36749

Do not update x and y of bounds.
  • Loading branch information
rainemak committed Nov 23, 2016
1 parent afaf4b4 commit 62b520a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -339,7 +339,12 @@ EmbedLitePuppetWidget::Resize(double aWidth, double aHeight, bool aRepaint)
} else {
mBounds.SizeTo(nsIntSize(NSToIntRound(aHeight), NSToIntRound(aWidth)));
}
mBounds.Deflate(mMargins);

// Do not move bounds here. Just alter size based on margins.
mBounds.y = 0;
mBounds.x = 0;
mBounds.width = std::max(0, (mBounds.width - std::max(0, mMargins.left) - std::max(0, mMargins.right)));
mBounds.height = std::max(0, (mBounds.height - std::max(0, mMargins.top) - std::max(0, mMargins.bottom)));

for (ObserverArray::size_type i = 0; i < mObservers.Length(); ++i) {
mObservers[i]->WidgetBoundsChanged(mBounds);
Expand Down

0 comments on commit 62b520a

Please sign in to comment.