#include "pdf/draw_utils/coordinates.h"
#include <math.h>
#include <algorithm>
#include "base/check_op.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_f.h"
namespace chrome_pdf {
namespace draw_utils {
IndexedPage::IndexedPage(int index, const gfx::Rect& rect)
: … { … }
IndexedPage::IndexedPage(const IndexedPage& other) = default;
IndexedPage& IndexedPage::operator=(const IndexedPage& other) = default;
IndexedPage::~IndexedPage() = default;
void AdjustBottomGapForRightSidePage(int page_x, gfx::Rect* bottom_gap) { … }
void CenterRectHorizontally(int doc_width, gfx::Rect* rect) { … }
void ExpandDocumentSize(const gfx::Size& rect_size, gfx::Size* doc_size) { … }
gfx::Rect GetBottomGapBetweenRects(int page_rect_bottom,
const gfx::Rect& bottom_rect) { … }
int GetMostVisiblePage(const std::vector<IndexedPage>& visible_pages,
const gfx::Rect& visible_screen) { … }
gfx::Insets GetPageInsetsForTwoUpView(size_t page_index,
size_t num_of_pages,
const gfx::Insets& single_view_insets,
int horizontal_separator) { … }
gfx::Rect GetRectForSingleView(const gfx::Size& rect_size,
const gfx::Size& document_size) { … }
gfx::Rect GetScreenRect(const gfx::Rect& rect,
const gfx::Point& position,
double zoom) { … }
gfx::Rect GetSurroundingRect(int page_y,
int page_height,
const gfx::Insets& insets,
int doc_width,
int bottom_separator) { … }
gfx::Rect GetLeftFillRect(const gfx::Rect& page_rect,
const gfx::Insets& insets,
int bottom_separator) { … }
gfx::Rect GetRightFillRect(const gfx::Rect& page_rect,
const gfx::Insets& insets,
int doc_width,
int bottom_separator) { … }
gfx::Rect GetBottomFillRect(const gfx::Rect& page_rect,
const gfx::Insets& insets,
int bottom_separator) { … }
gfx::Rect GetLeftRectForTwoUpView(const gfx::Size& rect_size,
const gfx::Point& position) { … }
gfx::Rect GetRightRectForTwoUpView(const gfx::Size& rect_size,
const gfx::Point& position) { … }
}
}