[7.8] ColoredArea is broken (perhaps others as well)

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

[7.8] ColoredArea is broken (perhaps others as well)

Boris Popov, DeepCove Labs (SNN)

“all of the below code was tested in clean visual.im in 7.8 and 7.7.1; just paste into the workspace and work away”

 

"if you execute the below, the window will remain black in 7.8, but become red in 7.7.1 "

gc := Window currentWindow graphicsContext.

area := ColoredArea model: ColorValue red asValue.

gc displayRectangle: gc clippingBounds.

area halt; displayOn: gc.

 

"if you inspect the below, the inspector will show empty preview in 7.8, but red preview in 7.7.1 "

ColoredArea model: ColorValue red asValue.

 

"the culprit appears to be this below change, it used to return #preferredBounds when container is nil, which is 'Screen default bounds' for View by default"

VisualPart>>bounds

                ^container == nil

                                ifTrue: [Rectangle zero]

                                ifFalse: [container compositionBoundsFor: self]

                               

"here's a fix/hack for ColoredView, but I do wonder if we'll run into other issues relating to this change in other visual parts"

ColoredArea>>bounds

                | rect |

                rect := super bounds.

                rect extent isZero ifTrue: [^self preferredBounds].

                ^rect.

 

-Boris


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

Re: [7.8] ColoredArea is broken (perhaps others as well)

Boris Popov, DeepCove Labs (SNN)

Just a follow up to see if anyone at Cincom noticed this report.

 

-Boris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Boris Popov, DeepCove Labs
Sent: Tuesday, June 14, 2011 11:24 AM
To: [hidden email]
Subject: [vwnc] [7.8] ColoredArea is broken (perhaps others as well)

 

“all of the below code was tested in clean visual.im in 7.8 and 7.7.1; just paste into the workspace and work away”

 

"if you execute the below, the window will remain black in 7.8, but become red in 7.7.1 "

gc := Window currentWindow graphicsContext.

area := ColoredArea model: ColorValue red asValue.

gc displayRectangle: gc clippingBounds.

area halt; displayOn: gc.

 

"if you inspect the below, the inspector will show empty preview in 7.8, but red preview in 7.7.1 "

ColoredArea model: ColorValue red asValue.

 

"the culprit appears to be this below change, it used to return #preferredBounds when container is nil, which is 'Screen default bounds' for View by default"

VisualPart>>bounds

                ^container == nil

                                ifTrue: [Rectangle zero]

                                ifFalse: [container compositionBoundsFor: self]

                               

"here's a fix/hack for ColoredView, but I do wonder if we'll run into other issues relating to this change in other visual parts"

ColoredArea>>bounds

                | rect |

                rect := super bounds.

                rect extent isZero ifTrue: [^self preferredBounds].

                ^rect.

 

-Boris


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