mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Stop rounding final column widths (up) to pixel boundaries. b=349297 r=bernd sr=roc
This commit is contained in:
parent
b20398943d
commit
7a03b97f01
@ -788,9 +788,6 @@ BasicTableLayoutStrategy::ComputeColumnWidths(const nsHTMLReflowState& aReflowSt
|
|||||||
l2t, c);
|
l2t, c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Hold previous to avoid accumulating rounding error.
|
|
||||||
nscoord prev_x = 0, prev_x_round = 0;
|
|
||||||
|
|
||||||
for (col = 0; col < colCount; ++col) {
|
for (col = 0; col < colCount; ++col) {
|
||||||
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
|
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
|
||||||
if (!colFrame) {
|
if (!colFrame) {
|
||||||
@ -873,18 +870,11 @@ BasicTableLayoutStrategy::ComputeColumnWidths(const nsHTMLReflowState& aReflowSt
|
|||||||
NS_ASSERTION(col_width >= colFrame->GetMinCoord(),
|
NS_ASSERTION(col_width >= colFrame->GetMinCoord(),
|
||||||
"assigned width smaller than min");
|
"assigned width smaller than min");
|
||||||
|
|
||||||
nscoord new_x = prev_x + col_width;
|
|
||||||
nscoord new_x_round = nsTableFrame::RoundToPixel(new_x);
|
|
||||||
|
|
||||||
nscoord old_final = colFrame->GetFinalWidth();
|
nscoord old_final = colFrame->GetFinalWidth();
|
||||||
nscoord new_final = new_x_round - prev_x_round;
|
colFrame->SetFinalWidth(col_width);
|
||||||
colFrame->SetFinalWidth(new_final);
|
|
||||||
|
|
||||||
if (old_final != new_final)
|
if (old_final != col_width)
|
||||||
mTableFrame->DidResizeColumns();
|
mTableFrame->DidResizeColumns();
|
||||||
|
|
||||||
prev_x = new_x;
|
|
||||||
prev_x_round = new_x_round;
|
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_TABLE_STRATEGY
|
#ifdef DEBUG_TABLE_STRATEGY
|
||||||
printf("ComputeColumnWidths final\n");
|
printf("ComputeColumnWidths final\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user