Merge pull request #11051 from Snuffleupagus/view-array-compare
Actually compare the `cropBox` and `mediaBox` correctly in the `Page.view` getter
This commit is contained in:
		
						commit
						aaef00ce5d
					
				@ -15,8 +15,9 @@
 | 
				
			|||||||
/* eslint no-var: error */
 | 
					/* eslint no-var: error */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  assert, bytesToString, FormatError, info, isArrayBuffer, isBool, isNum,
 | 
					  assert, bytesToString, FormatError, info, isArrayBuffer, isArrayEqual, isBool,
 | 
				
			||||||
  isSpace, isString, OPS, shadow, stringToBytes, stringToPDFString, Util, warn
 | 
					  isNum, isSpace, isString, OPS, shadow, stringToBytes, stringToPDFString, Util,
 | 
				
			||||||
 | 
					  warn
 | 
				
			||||||
} from '../shared/util';
 | 
					} from '../shared/util';
 | 
				
			||||||
import { Catalog, ObjectLoader, XRef } from './obj';
 | 
					import { Catalog, ObjectLoader, XRef } from './obj';
 | 
				
			||||||
import { Dict, isDict, isName, isStream, Ref } from './primitives';
 | 
					import { Dict, isDict, isName, isStream, Ref } from './primitives';
 | 
				
			||||||
@ -127,8 +128,8 @@ class Page {
 | 
				
			|||||||
    // "The crop, bleed, trim, and art boxes should not ordinarily
 | 
					    // "The crop, bleed, trim, and art boxes should not ordinarily
 | 
				
			||||||
    // extend beyond the boundaries of the media box. If they do, they are
 | 
					    // extend beyond the boundaries of the media box. If they do, they are
 | 
				
			||||||
    // effectively reduced to their intersection with the media box."
 | 
					    // effectively reduced to their intersection with the media box."
 | 
				
			||||||
    const mediaBox = this.mediaBox, cropBox = this.cropBox;
 | 
					    const { cropBox, mediaBox, } = this;
 | 
				
			||||||
    if (mediaBox === cropBox) {
 | 
					    if (cropBox === mediaBox || isArrayEqual(cropBox, mediaBox)) {
 | 
				
			||||||
      return shadow(this, 'view', mediaBox);
 | 
					      return shadow(this, 'view', mediaBox);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user