Commit d5c534f
committed
Reduce duplication when computing the maximum canvas pixels
*This is something that occurred to me when reviewing the latest PDF.js update in mozilla-central.*
Currently we duplicate essentially the same code in both the `OutputScale.prototype.limitCanvas` and `PDFPageDetailView.prototype.update` methods, which seems unnecessary, and to avoid that we introduce a new `OutputScale.capPixels` method that is used to compute the maximum canvas pixels.1 parent ca05a0d commit d5c534f
2 files changed
Lines changed: 12 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
| 668 | + | |
675 | 669 | | |
676 | 670 | | |
677 | 671 | | |
| |||
693 | 687 | | |
694 | 688 | | |
695 | 689 | | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
701 | 696 | | |
702 | 697 | | |
703 | 698 | | |
| 699 | + | |
704 | 700 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
| 701 | + | |
711 | 702 | | |
712 | 703 | | |
713 | 704 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 147 | | |
156 | 148 | | |
157 | 149 | | |
| |||
164 | 156 | | |
165 | 157 | | |
166 | 158 | | |
167 | | - | |
| 159 | + | |
| 160 | + | |
168 | 161 | | |
169 | 162 | | |
170 | 163 | | |
| |||
0 commit comments