# HG changeset patch # User Stefan Vogel # Date 1469006762 -7200 # Node ID 3be657fc460f4ad3b2fe6d700e4e8a1927a2dc5f # Parent 427a92692f52db61fc062b4b8b4b8558b098ddf6 #REFACTORING by stefan class: DeviceGraphicsContext changed: #setGCForPaint use #blackColor and #whiteColor diff -r 427a92692f52 -r 3be657fc460f DeviceGraphicsContext.st --- a/DeviceGraphicsContext.st Wed Jul 20 11:25:31 2016 +0200 +++ b/DeviceGraphicsContext.st Wed Jul 20 11:26:02 2016 +0200 @@ -1,3 +1,5 @@ +"{ Encoding: utf8 }" + " COPYRIGHT (c) 1992 by Claus Gittinger All Rights Reserved @@ -9,8 +11,6 @@ other person. No title to or ownership of the software is hereby transferred. " -'From Smalltalk/X, Version:7.1.0.0 on 19-07-2016 at 15:46:14' ! - "{ Package: 'stx:libview' }" "{ NameSpace: Smalltalk }" @@ -3922,67 +3922,67 @@ |dither map pixelId p fg bg vOrg ditherDepth deviceDepth| gcId notNil ifTrue:[ - paint isSymbol ifTrue:[ - "map symbols to colors" - paint := Color perform:paint ifNotUnderstood:[Color yellow]. - ]. - p := paint. - - p isColor ifTrue:[ - paint := p := p onDevice:device. - pixelId := p colorId. - pixelId notNil ifTrue:[ - " - a real (undithered) color - " - mask notNil ifTrue:[ - mask := nil. - device setBitmapMask:nil in:gcId - ]. - (p ~~ foreground) ifTrue:[ - foreground := paint. - device setForeground:pixelId in:gcId - ]. - ^ self - ]. - "a dithered color" - dither := paint ditherForm. - ] ifFalse:[ - "mhmh - seems to be some kind of form ..." - paint := paint onDevice:device. - dither := paint. - ]. - " - a dithered color or image - " - (ditherDepth := dither depth) == 1 ifTrue:[ - "a simple 0/1 bitmap" - map := dither colorMap. - "temporary (kludgy) fix for destroyed paint" - p := paint. - map isNil ifTrue:[ - fg := Color black. - bg := Color white. - ] ifFalse:[ - fg := map at:2. - bg := map at:1. - ]. - self foreground:fg background:bg. - paint := p - ] ifFalse:[ - deviceDepth := device depth. - (ditherDepth ~~ deviceDepth) ifTrue:[ - dither := dither asFormOn:device. - ditherDepth := dither depth. - (dither isNil or:[ditherDepth ~~ deviceDepth]) ifTrue:[ - self error:'bad dither'. - ^ self - ] - ] - ]. - self mask:dither. - vOrg := self viewOrigin. - self maskOriginX:vOrg x negated y:vOrg y negated. + paint isSymbol ifTrue:[ + "map symbols to colors" + paint := Color perform:paint ifNotUnderstood:[Color yellow]. + ]. + p := paint. + + p isColor ifTrue:[ + paint := p := p onDevice:device. + pixelId := p colorId. + pixelId notNil ifTrue:[ + " + a real (undithered) color + " + mask notNil ifTrue:[ + mask := nil. + device setBitmapMask:nil in:gcId + ]. + (p ~~ foreground) ifTrue:[ + foreground := paint. + device setForeground:pixelId in:gcId + ]. + ^ self + ]. + "a dithered color" + dither := paint ditherForm. + ] ifFalse:[ + "mhmh - seems to be some kind of form ..." + paint := paint onDevice:device. + dither := paint. + ]. + " + a dithered color or image + " + (ditherDepth := dither depth) == 1 ifTrue:[ + "a simple 0/1 bitmap" + map := dither colorMap. + "temporary (kludgy) fix for destroyed paint" + p := paint. + map isNil ifTrue:[ + fg := self blackColor. + bg := self whiteColor. + ] ifFalse:[ + fg := map at:2. + bg := map at:1. + ]. + self foreground:fg background:bg. + paint := p + ] ifFalse:[ + deviceDepth := device depth. + (ditherDepth ~~ deviceDepth) ifTrue:[ + dither := dither asFormOn:device. + ditherDepth := dither depth. + (dither isNil or:[ditherDepth ~~ deviceDepth]) ifTrue:[ + self error:'bad dither'. + ^ self + ] + ] + ]. + self mask:dither. + vOrg := self viewOrigin. + self maskOriginX:vOrg x negated y:vOrg y negated. ] "Created: 16.5.1996 / 15:35:51 / cg"