File tree Expand file tree Collapse file tree
ios/ReactNativePdfRendererLibrary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,20 +61,21 @@ -(void) setParams:(NSDictionary*) params {
6161 self.document = pdfDocument;
6262 });
6363
64- dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
65- // In certain scenarios, scaleFactorForSizeToFit may be 0.
66- // This results in invalid calculations for the CoreGraphics API, affecting the PDF positioning.
67- // Consequence: PDF displayed in the wrong position and zoom unavailable.
68- // This is a temporary workaround to handle the production bug until a better approach is implemented.
69- sleep (1 );
70-
71- dispatch_async (dispatch_get_main_queue (), ^{
72- self.minScaleFactor = self.scaleFactorForSizeToFit == 0 ? 1 : self.scaleFactorForSizeToFit ;
73- if (maxZoom > 0 ) {
74- self.maxScaleFactor = maxZoom * self.minScaleFactor ;
75- }
76- [self setNeedsLayout ];
77- });
64+ dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
65+ // In certain scenarios, scaleFactorForSizeToFit may be 0.
66+ // This results in invalid calculations for the CoreGraphics API, affecting the PDF positioning.
67+ // Consequence: PDF displayed in the wrong position and zoom unavailable.
68+ // This is a temporary workaround to handle the production bug until a better approach is implemented.
69+ sleep (1 );
70+
71+ dispatch_async (dispatch_get_main_queue (), ^{
72+ self.minScaleFactor = self.scaleFactorForSizeToFit == 0 ? 1 : self.scaleFactorForSizeToFit ;
73+ if (maxZoom > 0 ) {
74+ self.maxScaleFactor = maxZoom * self.minScaleFactor ;
75+ }
76+ [self setNeedsLayout ];
77+ });
78+ });
7879 } else {
7980 self.document = nil ;
8081 }
You can’t perform that action at this time.
0 commit comments