[Pharo-users] Re: Converting global coordinates from a mouse event

2025-03-11 Thread Mikael Svane
Hi Renaud, Yes, I use Spec with the Morphic graphical library and with the calculation that you described, I got the correct answer for the coordinates within the Morph representing the image (Form). Because I was using an autoscaling image, I had then to do one more step by scaling the loca

[Pharo-users] Updating a Form after changing pixel values

2025-03-07 Thread Mikael Svane
I have a Form where I change pixel colours using Form>>pixelValueAt:put:. The Form exists inside an SpImagePresenter. After having changed the pixels, I want to redraw the Form in an #updatePresenters method to show the changes, but I haven't been able to figure out how to do this. If I inspect the

[Pharo-users] Re: Converting global coordinates from a mouse event

2025-03-04 Thread Mikael Svane
self handleMouseDown: event image globa….. ]. On 2 Mar 2025, at 22:00, Mikael Svane wrote: I ha

[Pharo-users] Converting global coordinates from a mouse event

2025-03-03 Thread Mikael Svane
I have a presenter that is a subclass of SpPresenterWithModel and it contains, among other things, an ImagePresenter with an autoscaling image (a Form). I want to capture mouse clicks on the image and get the coordinate of the click relative to the upper left corner of the Form. My #initializeP