#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Sat, 24 Dec 2016 14:53:12 +0100
changeset 7759 45386945d6d7
parent 7758 2e96180d15d8
child 7760 4e4cae3921ea
#FEATURE by cg class: DeviceGraphicsContext added: #withPaint:do:
DeviceGraphicsContext.st
--- a/DeviceGraphicsContext.st	Fri Dec 23 13:19:00 2016 +0100
+++ b/DeviceGraphicsContext.st	Sat Dec 24 14:53:12 2016 +0100
@@ -3224,6 +3224,17 @@
     self foreground:oldFg background:background function:oldFun
 !
 
+withPaint:aColor do:aBlock
+    "evaluate aBlock with changed paint color."
+
+    |oldPaint|
+
+    oldPaint := paint.
+    self paint:aColor.
+    aBlock value.
+    self paint:oldPaint
+!
+
 xoring:aBlock
     "evaluate aBlock with function xoring"