<div dir="ltr">+1<br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-23 21:11 GMT+02:00 Fabio Niephaus <span dir="ltr"><<a href="mailto:lists@fniephaus.com" target="_blank">lists@fniephaus.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">Hi all,<div><br></div><div>I noticed that BitBlt's primitiveDisplayString fails relatively often and then found out that it's sometimes called to draw empty strings.</div><div><br></div><div>`(ByteString allInstances select: [:ea | ea isEmpty]) size` revealed that there are 2245 empty strings in my image and I assume some of them must be either in the FrameRateMorph morph or in the Clock morph.<br></div><div><br></div><div>Anyway...looking at BitBlt>>#primDisplayString:<wbr>from:to:map:xTable:kern:, the fallback code basically does nothing if stopIndex is zero (`startIndex to: stopIndex do: ...`) which makes sense.</div><div><br></div><div>What I think doesn't make sense is that the primitive fails in the first place. Instead of failing if stopIndex is not greater 0, I would suggest to use: `stopIndex < 1 ifTrue: [^ interpreterProxy pop: 6].` which cleans up the stack, leaves the receiver, and returns early.</div><div><br></div><div>Let me know what you think!</div><div><br></div><div><br></div><div>Fabio</div></div>
<br></blockquote></div><br></div>