浏览代码

Fixed behavior on resizing when image is not set, fixed bug where horizontal scrollbar was inoperable when the vertical scrollbar was invisible

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7241 8c9fc860-2736-0410-a75d-ab315db34111
skoster 8 年之前
父节点
当前提交
cfc9fa226a
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      source/WMStandardComponents.Mod

+ 5 - 2
source/WMStandardComponents.Mod

@@ -2879,6 +2879,9 @@ TYPE
 		PROCEDURE Resized*;
 		BEGIN			
 			Resized^;
+			IF img=NIL THEN
+				RETURN;
+			END;
 			IF img.width > bounds.GetWidth() THEN
 				dx := img.width - bounds.GetWidth();
 				hScrollbar.visible.Set(TRUE)
@@ -2890,7 +2893,7 @@ TYPE
 				dy := img.height - bounds.GetHeight();
 				vScrollbar.visible.Set(TRUE)
 			ELSE
-				dx := 0;
+				dy := 0;
 				vScrollbar.visible.Set(FALSE)
 			END;
 		END Resized;
@@ -2938,7 +2941,7 @@ TYPE
 					dy := img.height - bounds.GetHeight();
 					vScrollbar.visible.Set(TRUE)
 				ELSE
-					dx := 0;
+					dy := 0;
 					vScrollbar.visible.Set(FALSE)
 				END;
 				Invalidate