Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1217)

Unified Diff: Source/core/layout/MultiColumnFragmentainerGroup.cpp

Issue 1258883003: Get rid of subtract-one-whole-pixel hack. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/MultiColumnFragmentainerGroup.cpp
diff --git a/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/Source/core/layout/MultiColumnFragmentainerGroup.cpp
index abcd82192dd31de49a3ea03573d2613264d86667..12e4cb0f45a5f463fceb12c834dd0cce5e81a944 100644
--- a/Source/core/layout/MultiColumnFragmentainerGroup.cpp
+++ b/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -207,12 +207,13 @@ void MultiColumnFragmentainerGroup::collectLayerFragments(DeprecatedPaintLayerFr
// Now we know we intersect at least one column. Let's figure out the logical top and logical
// bottom of the area we're checking.
LayoutUnit layerLogicalTop = isHorizontalWritingMode ? layerBoundsInFlowThread.y() : layerBoundsInFlowThread.x();
- LayoutUnit layerLogicalBottom = (isHorizontalWritingMode ? layerBoundsInFlowThread.maxY() : layerBoundsInFlowThread.maxX()) - 1;
+ LayoutUnit layerLogicalBottom = (isHorizontalWritingMode ? layerBoundsInFlowThread.maxY() : layerBoundsInFlowThread.maxX());
// Figure out the start and end columns for the layer and only check within that range so that
// we don't walk the entire column row.
- unsigned startColumn = columnIndexAtOffset(layerLogicalTop);
- unsigned endColumn = columnIndexAtOffset(layerLogicalBottom);
+ unsigned startColumn;
+ unsigned endColumn;
+ columnIntervalForBlockRangeInFlowThread(layerLogicalTop, layerLogicalBottom, startColumn, endColumn);
// Now intersect with the columns actually occupied by the dirty rect, to narrow it down even further.
unsigned firstColumnInDirtyRect, lastColumnInDirtyRect;
@@ -513,6 +514,16 @@ unsigned MultiColumnFragmentainerGroup::columnIndexAtVisualPoint(const LayoutPoi
return std::min(unsigned(index), actualColumnCount() - 1);
}
+void MultiColumnFragmentainerGroup::columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThread, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastColumn) const
+{
+ ASSERT(logicalTopInFlowThread <= logicalBottomInFlowThread);
+ firstColumn = columnIndexAtOffset(logicalTopInFlowThread);
+ lastColumn = columnIndexAtOffset(logicalBottomInFlowThread);
+ // logicalBottomInFlowThread is an exclusive endpoint, so some additional adjustments may be necessary.
+ if (lastColumn > firstColumn && logicalTopInFlowThreadAt(lastColumn) == logicalBottomInFlowThread)
+ lastColumn--;
+}
+
void MultiColumnFragmentainerGroup::columnIntervalForVisualRect(const LayoutRect& rect, unsigned& firstColumn, unsigned& lastColumn) const
{
bool isColumnProgressionInline = m_columnSet.multiColumnFlowThread()->progressionIsInline();
« no previous file with comments | « Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698