Turn off the work of a scatter when the mouse is outside of visible part of the object

10 views
Skip to first unread message

me2 beats

unread,
Aug 5, 2018, 11:17:43 AM8/5/18
to Kivy users support
what is a good way to avoid such a behavior of the scatter (see attached gif)?

I mean I don't want the scatter to let me do scaling/translation/rotation outside the visible part of the image, that is, to move the image only when the mouse is inside the circle.

Scatter:
    size
: root.size
   
Image:
        source
: 'data/logo/kivy-icon-512.png'
        size
: self.parent.size
        allow_stretch
: True


I understand scatter is a rectangle and it can not be made in any other shape.
but I think there is a way to check if the mouse is on a colored or transparent pixel of the png image and if the pixel under the mouse is transparent, that is, we do not see the color here, then we set do_scale and do_translation = 0
scatter befavior.gif

me2 beats

unread,
Aug 5, 2018, 11:28:47 AM8/5/18
to Kivy users support
Reply all
Reply to author
Forward
0 new messages