On 04/01/18 19:04, Jeff wrote:
Some ten years ago various people on this list helped me write Perl bindings for GtkImageView.
[...]
Now I am trying to decide how to create the functionality of the widget in gtk+-3. I see a couple of options:
[...]
3. Do something basic in Perl. Is region selection even possible in pure Perl?
I've made some progress. Attached are a couple of small examples (drawingarea_pan.pl and drawingarea_rubberband.pl) for selecting a region of an image, and also panning and zooming an image. Probably thanks to Cairo, they are almost certainly quick enough for what I want, even though they are pure Perl. However, I don't understand why although panning and zooming works, the Cairo context never seems to reflect this in $context->user_to_device() If you run drawingarea_pan.pl, and try panning at various zoom levels in the top left hand corner (to keep the numbers small and simple), the coordinates are not affected by the zoom level or the amount of pan. What is going on? Why isn't user_to_device() working as I expect? Regards Jeff
Attachment:
drawingarea_rubberband.pl
Description: Perl program
Attachment:
drawingarea_pan.pl
Description: Perl program
Attachment:
signature.asc
Description: OpenPGP digital signature