File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace facebook ::react {
44
5- PdfViewState::PdfViewState () : width(1 ), height(1 ) {}
5+ namespace {
6+ // Heuristic: guess that new pages will be the same dimensions as the last
7+ // measured page.
8+ int defaultWidth = 1 ;
9+ int defaultHeight = 1 ;
10+ } // namespace
611
7- PdfViewState::PdfViewState (int _width, int _height) : width(_width), height(_height) {}
12+ PdfViewState::PdfViewState () : width(defaultWidth), height(defaultHeight) {}
13+
14+ PdfViewState::PdfViewState (int _width, int _height) : width(_width), height(_height) {
15+ defaultWidth = width;
16+ defaultHeight = height;
17+ }
818
919#ifdef RN_SERIALIZABLE_STATE
1020PdfViewState::PdfViewState (const PdfViewState& previousState, folly::dynamic data)
11- : width(data[" width" ].getInt()), height(data[" height" ].getInt()) {}
21+ : width(data[" width" ].getInt()), height(data[" height" ].getInt()) {
22+ defaultWidth = width;
23+ defaultHeight = height;
24+ }
1225
1326folly::dynamic PdfViewState::getDynamic () const {
1427 return folly::dynamic::object (" width" , width)(" height" , height);
You can’t perform that action at this time.
0 commit comments