[Cuis-dev] ImageMorph drawing

Juan Vuletich juan at cuis.st
Fri Sep 6 15:40:29 PDT 2024


Hi Bernhard,

On 9/5/2024 5:19 PM, Bernhard Pieber via Cuis-dev wrote:
> Greetings,
>
> If I do this I notice that the image is not centered in the border:
>
> imageMorph := ImageMorph new
> 	borderWidth: 2;
> 	borderColor: Color red;
> 	scaleBy: 6;
> 	openInWorld
>
> I have no idea why but if I add 1 to the point where the image is drawn, it looks symmetrical:
>
> drawOn: aCanvas
>
> 	aCanvas image: image at: (borderWidth at borderWidth + 1).
> 	(borderWidth>  0) ifTrue: [
> 		aCanvas
> 			frameRectangle:  (`0 at 0` extent: extent)
> 			color:  borderColor
> 			borderWidth:  borderWidth
> 			borderStyleSymbol:  #simple ]
>
> It's probably not the correct fix, though.
>
> There is still a small gap between the image and the border where the background shines through. I wonder how this could be avoided?
>
> Bernhard

Just pushed a fix. It is not perfect at all scales, due to quirks in 
WarpBlt. A better solution would require VectorEngine to know how to 
display images. Some day I hope to do that.

Thanks,

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich



More information about the Cuis-dev mailing list