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

Unified Diff: Source/core/page/PrintContext.cpp

Issue 1110483002: Remove argument |allowHorizontalTiling| from computePageRectWithPageSize (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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/page/PrintContext.h ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PrintContext.cpp
diff --git a/Source/core/page/PrintContext.cpp b/Source/core/page/PrintContext.cpp
index 0007cfb2fc7e41fe56ce6270b356f72213d0bfe5..909b3d95203f559fbee7bd2b61f8fb7e3e2f8658 100644
--- a/Source/core/page/PrintContext.cpp
+++ b/Source/core/page/PrintContext.cpp
@@ -81,16 +81,16 @@ void PrintContext::computePageRects(const FloatRect& printRect, float headerHeig
return;
}
- computePageRectsWithPageSizeInternal(FloatSize(pageWidth / userScaleFactor, pageHeight / userScaleFactor), false);
+ computePageRectsWithPageSizeInternal(FloatSize(pageWidth / userScaleFactor, pageHeight / userScaleFactor));
}
-void PrintContext::computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, bool allowHorizontalTiling)
+void PrintContext::computePageRectsWithPageSize(const FloatSize& pageSizeInPixels)
{
m_pageRects.clear();
- computePageRectsWithPageSizeInternal(pageSizeInPixels, allowHorizontalTiling);
+ computePageRectsWithPageSizeInternal(pageSizeInPixels);
}
-void PrintContext::computePageRectsWithPageSizeInternal(const FloatSize& pageSizeInPixels, bool allowInlineDirectionTiling)
+void PrintContext::computePageRectsWithPageSizeInternal(const FloatSize& pageSizeInPixels)
{
if (!m_frame->document() || !m_frame->view() || !m_frame->document()->layoutView())
return;
@@ -139,23 +139,13 @@ void PrintContext::computePageRectsWithPageSizeInternal(const FloatSize& pageSiz
int pageLogicalTop = blockDirectionEnd > blockDirectionStart ?
blockDirectionStart + i * pageLogicalHeight :
blockDirectionStart - (i + 1) * pageLogicalHeight;
- if (allowInlineDirectionTiling) {
- for (int currentInlinePosition = inlineDirectionStart;
- inlineDirectionEnd > inlineDirectionStart ? currentInlinePosition < inlineDirectionEnd : currentInlinePosition > inlineDirectionEnd;
- currentInlinePosition += (inlineDirectionEnd > inlineDirectionStart ? pageLogicalWidth : -pageLogicalWidth)) {
- int pageLogicalLeft = inlineDirectionEnd > inlineDirectionStart ? currentInlinePosition : currentInlinePosition - pageLogicalWidth;
- IntRect pageRect(pageLogicalLeft, pageLogicalTop, pageLogicalWidth, pageLogicalHeight);
- if (!isHorizontal)
- pageRect = pageRect.transposedRect();
- m_pageRects.append(pageRect);
- }
- } else {
- int pageLogicalLeft = inlineDirectionEnd > inlineDirectionStart ? inlineDirectionStart : inlineDirectionStart - pageLogicalWidth;
- IntRect pageRect(pageLogicalLeft, pageLogicalTop, pageLogicalWidth, pageLogicalHeight);
- if (!isHorizontal)
- pageRect = pageRect.transposedRect();
- m_pageRects.append(pageRect);
- }
+
+ int pageLogicalLeft = inlineDirectionEnd > inlineDirectionStart ? inlineDirectionStart : inlineDirectionStart - pageLogicalWidth;
+ IntRect pageRect(pageLogicalLeft, pageLogicalTop, pageLogicalWidth, pageLogicalHeight);
+ if (!isHorizontal)
+ pageRect = pageRect.transposedRect();
+ m_pageRects.append(pageRect);
+
}
}
@@ -207,7 +197,7 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi
printContext.begin(pageRect.width(), pageRect.height());
FloatSize scaledPageSize = pageSizeInPixels;
scaledPageSize.scale(frame->view()->contentsSize().width() / pageRect.width());
- printContext.computePageRectsWithPageSize(scaledPageSize, false);
+ printContext.computePageRectsWithPageSize(scaledPageSize);
int top = box->pixelSnappedOffsetTop();
int left = box->pixelSnappedOffsetLeft();
@@ -345,7 +335,7 @@ int PrintContext::numberOfPages(LocalFrame* frame, const FloatSize& pageSizeInPi
// Account for shrink-to-fit.
FloatSize scaledPageSize = pageSizeInPixels;
scaledPageSize.scale(frame->view()->contentsSize().width() / pageRect.width());
- printContext.computePageRectsWithPageSize(scaledPageSize, false);
+ printContext.computePageRectsWithPageSize(scaledPageSize);
return printContext.pageCount();
}
« no previous file with comments | « Source/core/page/PrintContext.h ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698