GraphicsMedium.st
branchdelegated_gc_jv
changeset 6730 73d56dff5532
parent 6472 5b21ff383a12
child 6731 24e7fa5e7f72
--- a/GraphicsMedium.st	Mon Jan 05 01:37:58 2015 +0100
+++ b/GraphicsMedium.st	Wed Jan 07 21:40:45 2015 +0100
@@ -9,10 +9,10 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-'From Smalltalk/X, Version:6.2.3.0 on 26-03-2014 at 14:24:09'                   !
-
 "{ Package: 'stx:libview' }"
 
+"{ NameSpace: Smalltalk }"
+
 Object subclass:#GraphicsMedium
 	instanceVariableNames:'gc width height realized'
 	classVariableNames:''
@@ -2134,65 +2134,10 @@
 		    height:(extent y)
 !
 
-displayRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
-    |right bottom wC hC wHalf hHalf isWin32|
-
-    "/ BIG KLUDGE WARNING HERE: the code below looks "good" on windows displays;
-    "/ (if you change anything under Unix, make it X-platform specific.
-    "/ (there seem to be drawing incompatibilities between Win- and XWorkstation)
-
-    isWin32 := self device platformName = 'WIN32'.
-
-    right := left + width-1.
-    bottom := top + height-1.
-
-    wC := wCorn.
-    hC := hCorn.
-
-    self scale = 1 ifTrue:[
-	wHalf := wC // 2.
-	hHalf := hC // 2.
-    ] ifFalse:[
-	wHalf := wC / 2.
-	hHalf := hC / 2.
-    ].
-
-    "top left arc"
-    self displayArcX:left y:top width:wC height:hC from:90 angle:90.
-
-    "top right arc"
-    self displayArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
-
-    "bottom right arc"
-    (isWin32 and:[self scale = 1]) ifTrue:[
-	self displayArcX:(right - wC+1) y:(bottom - hC+1) width:wC height:hC from:270 angle:90.
-    ] ifFalse:[
-	self displayArcX:(right - wC) y:(bottom - hC) width:wC height:hC from:270 angle:90.
-    ].
-
-    "bottom left arc"
-    self displayArcX:left y:(bottom - hC) width:wC height:hC from:180 angle:90.
-
-    "top line"
-    self displayLineFromX:(left + wHalf) y:top toX:(right - wHalf-1) y:top.
-
-    "left line"
-    self displayLineFromX:left y:(top + hHalf - 1) toX:left y:(bottom - hHalf - 2).
-
-    "bottom line"
-    self displayLineFromX:(left + wHalf-1) y:bottom
-		      toX:(right - wHalf ) y:bottom.
-
-    "right line"
-    self displayLineFromX:right y:(top + hHalf) toX:right y:(bottom - hHalf).
-
-
-    "
-     |v|
-
-     (v := View new) extent:200@200; openAndWait.
-     v displayRoundRectangleX:10 y:10 width:100 height:100 wCorner:20 hCorner:20
-    "
+displayRoundRectangleX:x y:y width:w height:h wCorner:wCorn hCorner:hCorn
+    gc displayRoundRectangleX:x y:y width:w height:h wCorner:wCorn hCorner:hCorn
+
+    "Modified: / 07-01-2015 / 20:17:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 displayString:aString at:aPoint
@@ -2975,60 +2920,10 @@
     self fillRectangleX:(origin x) y:(origin y) width:(extent x) height:(extent y)
 !
 
-fillRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
-    |right bottom wC hC wHalf hHalf|
-
-    right := left + width.
-    bottom := top + height.
-
-    wC := wCorn.
-    hC := hCorn.
-
-    wHalf := wC / 2.
-    hHalf := hC / 2.
-
-    self device platformName = #WIN32 ifTrue:[
-        "/ bug workaround
-        "top left arc"
-        self fillArcX:left y:top width:wC height:hC from:90 angle:90.
-        "top right arc"
-        self fillArcX:(right - wC - 1) y:top width:wC height:hC from:0 angle:90.
-        "bottom right arc"
-        self fillArcX:(right - wC - 1) y:(bottom - hC - 1) width:wC height:hC from:270 angle:90.
-        "bottom left arc"
-        self fillArcX:left y:(bottom - hC) width:wC height:hC-1 from:180 angle:90.
-
-        "center rectangle"
-        self fillRectangleX:(left + wHalf) y:top width:(width - wHalf - wHalf+1) height:height-1.
-        "left partial rectangle"
-        self fillRectangleX:left y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
-        "right partial rectangle"
-        self fillRectangleX:right-wHalf y:top+hHalf width:wHalf-1 height:(height-hHalf-hHalf).
-    ] ifFalse:[
-        "top left arc"
-        self fillArcX:left y:top width:wC height:hC from:90 angle:90.
-        "top right arc"
-        self fillArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
-        "bottom right arc"
-        self fillArcX:(right - wC - 1) y:(bottom - hC) width:wC height:hC from:270 angle:90.
-        "bottom left arc"
-        self fillArcX:left y:(bottom - hC) width:wC height:hC from:180 angle:90.
-
-        "center rectangle"
-        self fillRectangleX:(left + wHalf) y:top width:(width - wHalf - wHalf+1) height:height.
-        "left partial rectangle"
-        self fillRectangleX:left y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
-        "right partial rectangle"
-        self fillRectangleX:right-wHalf y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
-    ].
-
-
-    "
-     |v|
-
-     (v := View new) extent:200@200; openAndWait.
-     v fillRoundRectangleX:10 y:10 width:100 height:100 wCorner:20 hCorner:20
-    "
+fillRoundRectangleX:x y:y width:w height:h wCorner:wCorn hCorner:hCorn
+    gc fillRoundRectangleX:x y:y width:w height:h wCorner:wCorn hCorner:hCorn
+
+    "Modified: / 07-01-2015 / 20:18:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 invertRectangle:aRectangle
@@ -3314,3 +3209,10 @@
     gc createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV 
 ! !
 
+!GraphicsMedium class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+