<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/12/13 Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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&#39;t, there is BitBlt for that purpose, but who knows...).<br>

<br>Maybe we could fail primitivePixelValueAt if receiver is Byte like, and unhibernate in fallback code.<br>We would let every other BitBlt primitives accept a ByteArray to allow BitBlt tricks.<br><br>Thoughts?<br></div>

<div class="gmail_extra"><br></div></blockquote><div><br></div><div>No one raised a comment so far.<br></div><div>Isn&#39;t it a good idea to fail the primitive?<br></div><div>If yes, then it&#39;s very simple to implement, just add:<br>
<br>    (interpreterProxy isWords: bitmap)    ifFalse:[interpreterProxy primitiveFail].<br><br></div><div>somewhere in the preamble of  BitBltSimulation&gt;&gt;primitivePixelValueAtX: xVal y: yVal <br><br></div><div>I check the senders of pixelValueAt:, and some of them would loop over each pixel.<br>
So sending unhibernate at each pixel does not seem a good idea anyway.<br></div><div>Leaking unhibernate sends out of the loop neither is, because then 3rd party classes must be aware of an implementation detail of Form.<br>
</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">2013/12/13  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span><div>
<div class="h5"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/MorphicExtras-nice.137.mcz" target="_blank">http://source.squeak.org/trunk/MorphicExtras-nice.137.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: MorphicExtras-nice.137<br>
Author: nice<br>
Time: 13 December 2013, 10:07:57.316 pm<br>
UUID: 127ce68e-b210-42a3-b0b3-b40c69941d02<br>
Ancestors: MorphicExtras-nice.136<br>
<br>
Correct an awfull bug in PaintBoxMorph&gt;&gt;showColor<br>
One should NEVER send pixelValueAt: nor colorAt: to an hibernated Form (or ColorForm).<br>
<br>
=============== Diff against MorphicExtras-nice.136 ===============<br>
<br>
Item was changed:<br>
  ----- Method: PaintBoxMorph&gt;&gt;showColor (in category &#39;actions&#39;) -----<br>
  showColor<br>
        &quot;Display the current color in all brushes, both on and off.&quot;<br>
<br>
        | offIndex onIndex center |<br>
        currentColor ifNil: [^self].<br>
        &quot;colorPatch color: currentColor.        May delete later&quot;<br>
        (brushes isNil or: [brushes first owner ~~ self])<br>
                ifTrue:<br>
                        [brushes := OrderedCollection new.<br>
                        #(#brush1: #brush2: #brush3: #brush4: #brush5: #brush6:)<br>
                                do: [:sel | brushes addLast: (self submorphNamed: sel)]].<br>
+       brushes last offImage unhibernate.<br>
+       brushes last onImage unhibernate.<br>
+       brushes last pressedImage unhibernate.<br>
+       center := brushes last offImage extent // 2.<br>
+       offIndex := brushes last offImage pixelValueAt: center.<br>
+       onIndex := brushes last onImage pixelValueAt: center.<br>
-       center := (brushes sixth) offImage extent // 2.<br>
-       offIndex := (brushes sixth) offImage pixelValueAt: center.<br>
-       onIndex := (brushes sixth) onImage pixelValueAt: center.<br>
        brushes do:<br>
                        [:bb |<br>
                        bb offImage colors at: offIndex + 1 put: currentColor.<br>
                        bb offImage clearColormapCache.<br>
                        bb onImage colors at: onIndex + 1 put: currentColor.<br>
                        bb onImage clearColormapCache.<br>
                        bb invalidRect: bb bounds].<br>
        self invalidRect: (brushes first topLeft rect: brushes last bottomRight)!<br>
<br>
<br>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div></div>