[Vm-dev] Re: [squeak-dev] The Trunk: MorphicExtras-nice.137.mcz
nicolas.cellier.aka.nice at gmail.com
Fri Dec 13 21:09:58 UTC 2013
I feel like it would be better to change pixelValueAt: so as to always
unhibernate, but I did not dare if ever someone had the idea of sending it
in tight loops (one shouldn't, there is BitBlt for that purpose, but who
Maybe we could fail primitivePixelValueAt if receiver is Byte like, and
unhibernate in fallback code.
We would let every other BitBlt primitives accept a ByteArray to allow
2013/12/13 <commits at source.squeak.org>
> Nicolas Cellier uploaded a new version of MorphicExtras to project The
> ==================== Summary ====================
> Name: MorphicExtras-nice.137
> Author: nice
> Time: 13 December 2013, 10:07:57.316 pm
> UUID: 127ce68e-b210-42a3-b0b3-b40c69941d02
> Ancestors: MorphicExtras-nice.136
> Correct an awfull bug in PaintBoxMorph>>showColor
> One should NEVER send pixelValueAt: nor colorAt: to an hibernated Form (or
> =============== Diff against MorphicExtras-nice.136 ===============
> Item was changed:
> ----- Method: PaintBoxMorph>>showColor (in category 'actions') -----
> "Display the current color in all brushes, both on and off."
> | offIndex onIndex center |
> currentColor ifNil: [^self].
> "colorPatch color: currentColor. May delete later"
> (brushes isNil or: [brushes first owner ~~ self])
> [brushes := OrderedCollection new.
> #(#brush1: #brush2: #brush3: #brush4: #brush5:
> do: [:sel | brushes addLast: (self
> submorphNamed: sel)]].
> + brushes last offImage unhibernate.
> + brushes last onImage unhibernate.
> + brushes last pressedImage unhibernate.
> + center := brushes last offImage extent // 2.
> + offIndex := brushes last offImage pixelValueAt: center.
> + onIndex := brushes last onImage pixelValueAt: center.
> - center := (brushes sixth) offImage extent // 2.
> - offIndex := (brushes sixth) offImage pixelValueAt: center.
> - onIndex := (brushes sixth) onImage pixelValueAt: center.
> brushes do:
> [:bb |
> bb offImage colors at: offIndex + 1 put:
> bb offImage clearColormapCache.
> bb onImage colors at: onIndex + 1 put:
> bb onImage clearColormapCache.
> bb invalidRect: bb bounds].
> self invalidRect: (brushes first topLeft rect: brushes last
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev