checkin from browser
authorClaus Gittinger <cg@exept.de>
Thu, 19 Feb 1998 15:49:02 +0100
changeset 2060 effcaa60f42d
parent 2059 d0027278830c
child 2061 25c1fcc1d7e8
checkin from browser
Form.st
--- a/Form.st	Tue Feb 17 20:49:32 1998 +0100
+++ b/Form.st	Thu Feb 19 15:49:02 1998 +0100
@@ -833,7 +833,7 @@
      inData tmpData info
      srcIndex "{ Class: SmallInteger }"
      dstIndex "{ Class: SmallInteger }"
-     buffer|
+     buffer spaceBitsPerPixel|
 
     data notNil ifTrue:[
         ^ data
@@ -845,7 +845,18 @@
         ^ nil
     ].
 
-    bytesPerLine := (width * depth + 31) // 32 * 4.
+    spaceBitsPerPixel := depth.
+    (depth > 8) ifTrue:[
+        spaceBitsPerPixel := 16.
+        (depth > 16) ifTrue:[
+            spaceBitsPerPixel := 32.
+            (depth > 32) ifTrue:[
+                spaceBitsPerPixel := depth.
+            ]
+        ]
+    ].
+
+    bytesPerLine := (width * spaceBitsPerPixel + 31) // 32 * 4.
     inData := ByteArray uninitializedNew:(bytesPerLine * height).
     info := device getBitsFromPixmapId:drawableId x:0 y:0 width:width height:height into:inData. 
     bytesPerLineIn := (info at:#bytesPerLine).                    "what I got"
@@ -907,7 +918,7 @@
 
     ^ inData.
 
-    "Modified: 23.4.1997 / 14:17:08 / cg"
+    "Modified: / 19.2.1998 / 14:47:06 / cg"
 !
 
 bits:aByteArray
@@ -1833,6 +1844,6 @@
 !Form class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Form.st,v 1.87 1997-12-04 09:58:01 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Form.st,v 1.88 1998-02-19 14:49:02 cg Exp $'
 ! !
 Form initialize!