[vwnc] A question on GraphicsContext's ...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] A question on GraphicsContext's ...

Dennis smith-4
I have a displayable object which gets passed
    obj displayOn: aGc

I do this
    gc := aGc copy.
    gc paint: ColorValue yellow.
    gc displayRectangle: aRectangle

Then all subsequent lines displayed using the original GraphicsContext
are yellow ???

I thought the "copy" would prevent that?

The original paint is "SymbolicPaint foreground"

Any suggestions?

--
Dennis Smith                         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] A question on GraphicsContext's ...

Claus Kick

> I have a displayable object which gets passed
>     obj displayOn: aGc
>
> I do this
>     gc := aGc copy.
>     gc paint: ColorValue yellow.
>     gc displayRectangle: aRectangle
>
> Then all subsequent lines displayed using the original GraphicsContext
> are yellow ???
>
> I thought the "copy" would prevent that?

Perhaps #copy is not deep enough and you need a #deepCopy instead?
 
-- 
Claus Kick

"Wenn Sie mich suchen: Ich halte mich in der Nähe des Wahnsinns auf. 
Genauer gesagt auf der schmalen Linie zwischen Wahnsinn und Panik. 
Gleich um die Ecke von Todesangst, nicht weit weg von Irrwitz und Idiotie."

"If you are looking for me: I am somewhere near to lunacy. 
More clearly, on the narrow path between lunacy and panic. 
Right around the corner of  fear of death, 
not far away from idiotism and insanity."

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] A question on GraphicsContext's ...

Dennis smith-4
Thanks -- you were close -- at least you indicated it should not do what its doing.

I had an instance-variable "colour" and much later (after writing the code a few years ago)
I added a method that used "colour" as a temp-variable -- fixed that and now it works as expected

Claus Kick wrote:
I have a displayable object which gets passed
    obj displayOn: aGc

I do this
    gc := aGc copy.
    gc paint: ColorValue yellow.
    gc displayRectangle: aRectangle

Then all subsequent lines displayed using the original GraphicsContext 
are yellow ???

I thought the "copy" would prevent that?
    

Perhaps #copy is not deep enough and you need a #deepCopy instead?
 
-- 
Claus Kick

"Wenn Sie mich suchen: Ich halte mich in der Nähe des Wahnsinns auf. 
Genauer gesagt auf der schmalen Linie zwischen Wahnsinn und Panik. 
Gleich um die Ecke von Todesangst, nicht weit weg von Irrwitz und Idiotie."

"If you are looking for me: I am somewhere near to lunacy. 
More clearly, on the narrow path between lunacy and panic. 
Right around the corner of  fear of death, 
not far away from idiotism and insanity."
  

-- 
Dennis Smith                 		         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a class="moz-txt-link-freetext" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada			         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc