mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-12 05:31:29 +00:00
Fixed: Compared the rects minimum x value with it self instead of the visible minimum x value. Also fixed the test case to catch this.
This commit is contained in:
+1
-1
@@ -2730,7 +2730,7 @@ setBoundsOrigin:
|
||||
doesItFitForWidth = documentViewVisibleRect.size.width >= rectInDocumentView.size.width;
|
||||
|
||||
// One of the following has to be true since our current visible rect didn't contain aRect.
|
||||
if (rectInDocumentViewMinX < rectInDocumentViewMinX && doesItFitForWidth)
|
||||
if (rectInDocumentViewMinX < documentViewVisibleRectMinX && doesItFitForWidth)
|
||||
// Scroll to left edge of aRect as it is to the left of the visible rect and it fit inside
|
||||
scrollPoint.x = rectInDocumentViewMinX;
|
||||
else if (CGRectGetMaxX(rectInDocumentView) > CGRectGetMaxX(documentViewVisibleRect) && doesItFitForWidth)
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
|
||||
[scrollView setDocumentView:documentView];
|
||||
|
||||
[textField1 setFrameOrigin:CGPointMake(0, 0)];
|
||||
[textField1 setFrameOrigin:CGPointMake(10, 10)];
|
||||
[textField2 setFrameOrigin:CGPointMake(500, 500)];
|
||||
|
||||
[documentView addSubview:textField1];
|
||||
@@ -260,7 +260,7 @@
|
||||
visibleRect = [documentView visibleRect];
|
||||
|
||||
// We should now be back at top left corner
|
||||
[self assertPoint:CGPointMake(0, 0) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner again"];
|
||||
[self assertPoint:CGPointMake(10, 10) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner again"];
|
||||
|
||||
// Try to scroll again and it should not scroll
|
||||
hasScrolled = [textField1 scrollRectToVisible:[textField1 bounds]];
|
||||
|
||||
Reference in New Issue
Block a user