Преглед изворни кода

170204
Fixed display issue for iPad pro.
eSign 1.21 release version

Ray Zhang пре 9 година
родитељ
комит
6d9a277479

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
RedAnt ERP Mobile/common/Functions/signature/signature.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="ipad9_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -22,7 +22,7 @@
                         <subviews>
                             <imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1eC-0c-wj1" customClass="SignatureView">
                                 <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
                             </imageView>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

+ 2 - 1
RedAnt ERP Mobile/common/PDFUtils.h

@@ -16,5 +16,6 @@
 //+ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to;
 +(NSString*)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document window_rect:(CGRect)window_rect name:(NSString*)name;
 +(NSMutableDictionary*) loadControl:(NSString*)templateName;
-
++(CGRect)WindowRect2PDFRect:(CGRect)rect pdf_rect:(CGRect)pdf_rect window_size:(CGSize)window_size;
++(CGRect)PDFRect2WindowRect:(CGRect)rect pdf_rect:(CGRect)pdf_rect window_size:(CGSize)window_size;
 @end

+ 30 - 1
RedAnt ERP Mobile/common/PDFUtils.m

@@ -175,7 +175,36 @@
     return CGRectMake(x, y, width, height);
     
 }
-
++(CGRect)PDFRect2WindowRect:(CGRect)rect pdf_rect:(CGRect)pdf_rect window_size:(CGSize)window_size
+{
+    CGRect win_expand;
+    float offset_x = 0;
+    float offset_y = 0;
+    float scale =1;
+    if(pdf_rect.size.height>=pdf_rect.size.width)
+    {
+        
+        
+        
+        win_expand = CGRectMake(window_size.width/2-(window_size.height*pdf_rect.size.width/pdf_rect.size.height)/2, 0, (window_size.height*pdf_rect.size.width/pdf_rect.size.height), window_size.height);
+        offset_x = (win_expand.size.width-window_size.width)/2;
+        scale = window_size.height/pdf_rect.size.height;
+        
+    }
+    else
+    {
+        win_expand = CGRectMake(0, window_size.height/2-(window_size.width*pdf_rect.size.height/pdf_rect.size.width)/2, window_size.width, (window_size.width*pdf_rect.size.height/pdf_rect.size.width));
+        offset_y = (win_expand.size.height-window_size.height)/2;
+        scale = window_size.width/pdf_rect.size.width;
+    }
+    float x=rect.origin.x*scale-offset_x;
+    float y=rect.origin.y*scale-offset_y;
+    float width = rect.size.width*scale;
+    float height = rect.size.height*scale;
+    
+    return CGRectMake(x, y, width, height);
+    
+}
 
 +(NSString*)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document window_rect:(CGRect)window_rect name:(NSString*)name
 {