Browse Source

【Form表单】Form表单添加限制最小位置

niehaoyu 8 months ago
parent
commit
733edb53b7

+ 6 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -3652,6 +3652,12 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                 if (defaultSize.height/2.0 + pagePoint.y > page.bounds.size.height) {
                     pagePoint.y = page.bounds.size.height - defaultSize.height/2.0 - 10;
                 }
+                if (pagePoint.x < defaultSize.width/2) {
+                    pagePoint.x = defaultSize.width/2 + 5;
+                }
+                if (pagePoint.y < defaultSize.height/2) {
+                    pagePoint.y = defaultSize.height/2 + 5;
+                }
                 
                 annotation = [self addFormAnnotationWithType:self.annotationType selection:nil page:page bounds:SKRectFromCenterAndSize(NSMakePoint(round(pagePoint.x), round(pagePoint.y)), defaultSize)];
                 [self showEditableFormAnnotationEditor:annotation];