DeviceGraphicsContext.st
branchdelegated_gc
changeset 6491 bbc6f0fef5c5
parent 6485 14afc96826c4
child 6582 2ac024ae60e9
--- a/DeviceGraphicsContext.st	Fri May 23 17:42:24 2014 +0200
+++ b/DeviceGraphicsContext.st	Thu Jun 05 17:48:00 2014 +0200
@@ -9,7 +9,7 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-'From Smalltalk/X, Version:6.2.3.0 on 23-05-2014 at 17:22:04'                   !
+'From Smalltalk/X, Version:6.2.4.0 on 05-06-2014 at 08:14:45'                   !
 
 "{ Package: 'stx:libview' }"
 
@@ -1859,7 +1859,8 @@
     "/ check if this string is too long and cut it into a managable size.
     "/ this is due to win32 limitations which seems to be unable to handle strings
     "/ which are drawn longer than 32k pixels.
-    (maxWidth notNil and:[(index2 - index1) > 500]) ifTrue:[
+    nChars := 500.
+    (maxWidth notNil and:[(index2 - index1) > nChars]) ifTrue:[
         nSkipLeft := wSkipLeft := 0.
 
         "/ if the draw starts to the left of the window start,
@@ -1878,10 +1879,12 @@
         ].
 
 "/ ('n=%d w=%d' printfWith:nChars with:wString) printCR.
-        [ ((pX+wString) < maxWidth) and:[ index2Guess < index2] ] whileTrue:[  "/ not enough...
-            nChars := (nChars * 1.1) rounded.
+        [ 
             index2Guess := (index1+nChars-1) min:index2.
             wString := fontUsed widthOf:aString from:index1 to:index2Guess.
+            ((pX+wString) < maxWidth) and:[ index2Guess < index2] 
+        ] whileTrue:[  "/ not enough...
+            nChars := (nChars * 1.1) rounded.
         ].
 "/ ('n=%d w=%d' printfWith:nChars with:wString) printCR.
         index2 := index2Guess.
@@ -2099,9 +2102,9 @@
     gcId isNil ifTrue:[
         self initGC
     ].
-    (deviceFormGCId := deviceForm gcId) isNil ifTrue:[
-        "/ device needGCForBitmapSource  - i.e. WIN32
-        device platformName ~= 'X11' ifTrue:[
+    "/ device needGCForBitmapSource  - i.e. WIN32
+    device platformName ~= 'X11' ifTrue:[
+        (deviceFormGCId := deviceForm gcId) isNil ifTrue:[
             deviceForm initGC.
             deviceFormGCId := deviceForm gcId.
         ]
@@ -4134,11 +4137,11 @@
 !DeviceGraphicsContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.137.2.2 2014-05-23 15:42:24 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.137.2.3 2014-06-05 15:48:00 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.137.2.2 2014-05-23 15:42:24 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.137.2.3 2014-06-05 15:48:00 stefan Exp $'
 ! !